Changeset 341aa39 for libcfa/src


Ignore:
Timestamp:
Apr 20, 2021, 5:19:07 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:
c41c2dbe
Parents:
0583b47b
Message:

Fix bugs in workstealing edge cases:

  • cutoff was wrong of all local queues are empty
  • target would get stuck if the rng returned the local queues
File:
1 edited

Legend:

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

    r0583b47b r341aa39  
    417417                        unsigned long long tsc2 = ts(lanes.data[idx2]);
    418418                        proc->rdq.cutoff = min(tsc1, tsc2);
    419                 }
    420                 else if(lanes.tscs[proc->rdq.target].tv < proc->rdq.cutoff) {
    421                         $thread * t = try_pop(cltr, proc->rdq.target __STATS(, __tls_stats()->ready.pop.help));
     419                        if(proc->rdq.cutoff == 0) proc->rdq.cutoff = -1ull;
     420                }
     421                else {
     422                        unsigned target = proc->rdq.target;
    422423                        proc->rdq.target = -1u;
    423                         if(t) return t;
     424                        if(lanes.tscs[target].tv < proc->rdq.cutoff) {
     425                                $thread * t = try_pop(cltr, target __STATS(, __tls_stats()->ready.pop.help));
     426                                if(t) return t;
     427                        }
    424428                }
    425429
Note: See TracChangeset for help on using the changeset viewer.