Changeset 9cac0da


Ignore:
Timestamp:
May 19, 2021, 1:34:11 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
b808625
Parents:
d36bac7
Message:

Small fixes to how timestamp is handled in workstealing queue.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/ready_queue.cfa

    rd36bac7 r9cac0da  
    409409                        unsigned target = proc->rdq.target;
    410410                        proc->rdq.target = -1u;
    411                         if(lanes.tscs[target].tv < proc->rdq.cutoff) {
     411                        const unsigned long long bias = 0; //2_500_000_000;
     412                        const unsigned long long cutoff = proc->rdq.cutoff > bias ? proc->rdq.cutoff - bias : proc->rdq.cutoff;
     413                        if(lanes.tscs[target].tv < cutoff && ts(lanes.data[target]) < cutoff) {
    412414                                $thread * t = try_pop(cltr, target __STATS(, __tls_stats()->ready.pop.help));
    413415                                if(t) return t;
     
    571573                lanes.tscs = alloc(lanes.count, lanes.tscs`realloc);
    572574                for(i; lanes.count) {
    573                         lanes.tscs[i].tv = ts(lanes.data[i]);
     575                        unsigned long long tsc = ts(lanes.data[i]);
     576                        lanes.tscs[i].tv = tsc != 0 ? tsc : rdtscl();
    574577                }
    575578        #endif
Note: See TracChangeset for help on using the changeset viewer.