Changeset bd0bdd37
- Timestamp:
- Mar 25, 2021, 3:09:01 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:
- 08e75215, 2d95a2d
- Parents:
- 3143f28
- Location:
- libcfa/src/concurrency
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.hfa
r3143f28 rbd0bdd37 69 69 // Cluster from which to get threads 70 70 struct cluster * cltr; 71 72 // Id within the cluster 73 unsigned cltr_id; 71 74 72 75 // Set to true to notify the processor should terminate -
libcfa/src/concurrency/kernel/startup.cfa
r3143f28 rbd0bdd37 486 486 487 487 // Adjust the ready queue size 488 ready_queue_grow( cltr, target );488 this.cltr_id = ready_queue_grow( cltr, target ); 489 489 490 490 // Unlock the RWlock -
libcfa/src/concurrency/kernel_private.hfa
r3143f28 rbd0bdd37 278 278 //----------------------------------------------------------------------- 279 279 // Increase the width of the ready queue (number of lanes) by 4 280 void ready_queue_grow (struct cluster * cltr, int target);280 unsigned ready_queue_grow (struct cluster * cltr, int target); 281 281 282 282 //----------------------------------------------------------------------- -
libcfa/src/concurrency/ready_queue.cfa
r3143f28 rbd0bdd37 252 252 preferred = 253 253 //* 254 kernelTLS().this_processor ? kernelTLS().this_processor-> id * 4: -1;254 kernelTLS().this_processor ? kernelTLS().this_processor->cltr_id : -1; 255 255 /*/ 256 256 thrd->link.preferred * 4; … … 330 330 #if defined(BIAS) 331 331 // Don't bother trying locally too much 332 preferred = kernelTLS().this_processor-> id * 4;332 preferred = kernelTLS().this_processor->cltr_id; 333 333 #endif 334 334 … … 525 525 526 526 // Grow the ready queue 527 void ready_queue_grow (struct cluster * cltr, int target) { 527 unsigned ready_queue_grow(struct cluster * cltr, int target) { 528 unsigned preferred; 529 size_t ncount; 530 528 531 /* paranoid */ verify( ready_mutate_islocked() ); 529 532 __cfadbg_print_safe(ready_queue, "Kernel : Growing ready queue\n"); … … 540 543 // Find new count 541 544 // Make sure we always have atleast 1 list 542 size_t ncount = target >= 2 ? target * 4: 1; 545 if(target >= 2) { 546 ncount = target * 4; 547 preferred = ncount - 4; 548 } else { 549 ncount = 1; 550 preferred = 0; 551 } 543 552 544 553 // Allocate new array (uses realloc and memcpies the data) … … 575 584 576 585 /* paranoid */ verify( ready_mutate_islocked() ); 586 return preferred; 577 587 } 578 588
Note: See TracChangeset
for help on using the changeset viewer.