Changeset cf08cb2


Ignore:
Timestamp:
Apr 2, 2022, 4:51:07 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
bdb4c3c
Parents:
bbf6a180 (diff), 928128d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/concurrent/readyQ/leader_spin.cfa

    rbbf6a180 rcf08cb2  
    1414//
    1515
    16 #include <bits/random.hfa>
     16#include <stdlib.hfa>
    1717#include <fstream.hfa>
    1818#include <thread.hfa>
     
    2626}
    2727
    28 __uint128_t lead_seed;
     28PRNG lead_rng;
    2929volatile unsigned leader;
    3030volatile size_t lead_idx;
     
    6565        waitgroup();
    6666
    67         unsigned nleader = lehmer64( lead_seed ) % nthreads;
     67        unsigned nleader = prng( lead_rng, nthreads );
    6868        __atomic_store_n( &leader, nleader, __ATOMIC_SEQ_CST );
    6969}
     
    9898// ==================================================
    9999int main(int argc, char * argv[]) {
    100         uint64_t lead_seed = prng();
    101         for(10) lehmer64( lead_seed );
    102 
    103100        lead_idx = 0;
    104         leader = lehmer64( lead_seed ) % nthreads;
     101        leader = prng( lead_rng, nthreads );
    105102
    106103        the_main = active_thread();
Note: See TracChangeset for help on using the changeset viewer.