Ignore:
Timestamp:
Aug 9, 2021, 4:21:44 PM (18 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
d874f59
Parents:
4f89e7b (diff), 5438e41 (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
  • libcfa/src/concurrency/ready_queue.cfa

    r4f89e7b r50b29d9  
    345345                        /* paranoid */ verify(lanes.count < 65536); // The following code assumes max 65536 cores.
    346346                        /* paranoid */ verify(map.count < 65536); // The following code assumes max 65536 cores.
    347                         uint64_t chaos = __tls_rand();
    348                         uint64_t high_chaos = (chaos >> 32);
    349                         uint64_t  mid_chaos = (chaos >> 16) & 0xffff;
    350                         uint64_t  low_chaos = chaos & 0xffff;
    351 
    352                         unsigned me = map.self;
    353                         unsigned cpu_chaos = map.start + (mid_chaos % map.count);
    354                         bool global = cpu_chaos == me;
    355 
    356                         if(global) {
    357                                 proc->rdq.target = high_chaos % lanes.count;
     347
     348                        if(0 == (__tls_rand() % 10_000)) {
     349                                proc->rdq.target = __tls_rand() % lanes.count;
    358350                        } else {
    359                                 proc->rdq.target = (cpu_chaos * READYQ_SHARD_FACTOR) + (low_chaos % READYQ_SHARD_FACTOR);
     351                                unsigned cpu_chaos = map.start + (__tls_rand() % map.count);
     352                                proc->rdq.target = (cpu_chaos * READYQ_SHARD_FACTOR) + (__tls_rand() % READYQ_SHARD_FACTOR);
    360353                                /* paranoid */ verify(proc->rdq.target >= (map.start * READYQ_SHARD_FACTOR));
    361354                                /* paranoid */ verify(proc->rdq.target <  ((map.start + map.count) * READYQ_SHARD_FACTOR));
Note: See TracChangeset for help on using the changeset viewer.