Changeset 928128d
- Timestamp:
- Apr 2, 2022, 2:58:36 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- cf08cb2
- Parents:
- f8fc560
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrent/readyQ/leader_spin.cfa
rf8fc560 r928128d 14 14 // 15 15 16 #include < bits/random.hfa>16 #include <stdlib.hfa> 17 17 #include <fstream.hfa> 18 18 #include <thread.hfa> … … 26 26 } 27 27 28 __uint128_t lead_seed;28 PRNG lead_rng; 29 29 volatile unsigned leader; 30 30 volatile size_t lead_idx; … … 65 65 waitgroup(); 66 66 67 unsigned nleader = lehmer64( lead_seed ) % nthreads;67 unsigned nleader = prng( lead_rng, nthreads ); 68 68 __atomic_store_n( &leader, nleader, __ATOMIC_SEQ_CST ); 69 69 } … … 98 98 // ================================================== 99 99 int main(int argc, char * argv[]) { 100 uint64_t lead_seed = prng();101 for(10) lehmer64( lead_seed );102 103 100 lead_idx = 0; 104 leader = lehmer64( lead_seed ) % nthreads;101 leader = prng( lead_rng, nthreads ); 105 102 106 103 the_main = active_thread();
Note: See TracChangeset
for help on using the changeset viewer.