Changeset f302d80
- Timestamp:
- May 5, 2021, 1:17:07 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:
- b9376fe
- Parents:
- f55d54d
- Location:
- libcfa/src/concurrency
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/ready_queue.cfa
rf55d54d rf302d80 406 406 407 407 // WARNING: std::min is polymorphic and therefore causes 500% slowdown instead of the expected 2% 408 proc->rdq.cutoff = tsc1 < tsc2 ? tsc1 : tsc2; 408 proc->rdq.cutoff = tsc1 < tsc2 ? tsc1 : tsc2; 409 409 } 410 410 else { … … 469 469 // Actually pop the list 470 470 struct $thread * thrd; 471 thrd = pop(lane); 471 unsigned long long tsv; 472 [thrd, tsv] = pop(lane); 472 473 473 474 /* paranoid */ verify(thrd); … … 481 482 482 483 #if defined(USE_WORK_STEALING) 483 lanes.tscs[w].tv = t hrd->link.ts;484 lanes.tscs[w].tv = tsv; 484 485 #endif 485 486 … … 663 664 while(!is_empty(lanes.data[idx])) { 664 665 struct $thread * thrd; 665 thrd = pop(lanes.data[idx]); 666 unsigned long long _; 667 [thrd, _] = pop(lanes.data[idx]); 666 668 667 669 push(cltr, thrd); -
libcfa/src/concurrency/ready_subqueue.hfa
rf55d54d rf302d80 53 53 // Push a thread onto this lane 54 54 // returns true of lane was empty before push, false otherwise 55 void push( __intrusive_lane_t & this, $thread * node ) {55 static inline void push( __intrusive_lane_t & this, $thread * node ) { 56 56 /* paranoid */ verify( node->link.next == 0p ); 57 57 /* paranoid */ verify( node->link.ts == 0 ); … … 77 77 // returns popped 78 78 // returns true of lane was empty before push, false otherwise 79 $thread *pop( __intrusive_lane_t & this ) {79 static inline [* $thread, unsigned long long] pop( __intrusive_lane_t & this ) { 80 80 /* paranoid */ verify( this.anchor.next != 0p ); 81 81 /* paranoid */ verify( this.anchor.ts != 0 ); 82 82 83 83 // Get the relevant nodes locally 84 unsigned long long ts = this.anchor.ts; 84 85 $thread * node = this.anchor.next; 85 86 this.anchor.next = node->link.next; … … 94 95 /* paranoid */ verify( node->link.next == 0p ); 95 96 /* paranoid */ verify( node->link.ts == 0 ); 96 return node;97 return [node, ts]; 97 98 } 98 99
Note: See TracChangeset
for help on using the changeset viewer.