Changeset 1680072
- Timestamp:
- May 12, 2021, 1:36:54 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 1e5cd9a
- Parents:
- c8ffd74f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/ready_queue.cfa
rc8ffd74f r1680072 398 398 399 399 if(proc->rdq.target == -1u) { 400 _Static_assert(READYQ_SHARD_FACTOR == 2); 401 unsigned idx1 = proc->rdq.id + 0; 402 unsigned idx2 = proc->rdq.id + 1; 403 unsigned long long tsc1 = ts(lanes.data[idx1]); 404 unsigned long long tsc2 = ts(lanes.data[idx2]); 400 unsigned long long min = ts(lanes.data[proc->rdq.id]); 401 for(int i = 0; i < READYQ_SHARD_FACTOR; i++) { 402 unsigned long long tsc = ts(lanes.data[proc->rdq.id + i]); 403 if(tsc < min) min = tsc; 404 } 405 proc->rdq.cutoff = min; 405 406 proc->rdq.target = __tls_rand() % lanes.count; 406 407 // WARNING: std::min is polymorphic and therefore causes 500% slowdown instead of the expected 2%408 proc->rdq.cutoff = tsc1 < tsc2 ? tsc1 : tsc2;409 407 } 410 408 else {
Note: See TracChangeset
for help on using the changeset viewer.