Changeset 320ec6fc for libcfa/src/concurrency/ready_queue.cfa
- Timestamp:
- Jul 24, 2020, 1:11:39 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 39fc03e
- Parents:
- f4ec4a90
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/ready_queue.cfa
rf4ec4a90 r320ec6fc 37 37 #endif 38 38 39 #define BIAS 6439 #define BIAS 16 40 40 41 41 // returns the maximum number of processors the RWLock support … … 500 500 501 501 // Grow the ready queue 502 void ready_queue_grow (struct cluster * cltr ) {502 void ready_queue_grow (struct cluster * cltr, int target) { 503 503 /* paranoid */ verify( ready_mutate_islocked() ); 504 504 __cfadbg_print_safe(ready_queue, "Kernel : Growing ready queue\n"); … … 515 515 // increase count 516 516 ncount += 4; 517 /* paranoid */ verify( ncount == target * 4 || target < 2 ); 517 518 518 519 // Allocate new array (uses realloc and memcpies the data) … … 550 551 551 552 // Shrink the ready queue 552 void ready_queue_shrink(struct cluster * cltr ) {553 void ready_queue_shrink(struct cluster * cltr, int target) { 553 554 /* paranoid */ verify( ready_mutate_islocked() ); 554 555 __cfadbg_print_safe(ready_queue, "Kernel : Shrinking ready queue\n"); … … 566 567 // reduce the actual count so push doesn't use the old queues 567 568 lanes.count -= 4; 568 verify(ocount > lanes.count); 569 /* paranoid */ verify( ocount > lanes.count ); 570 /* paranoid */ verify( lanes.count == target * 4 || target < 2 ); 569 571 570 572 // for printing count the number of displaced threads
Note: See TracChangeset
for help on using the changeset viewer.