- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/ready_queue.cfa
r32c2c5e rbd0bdd37 39 39 #endif 40 40 41 #define BIAS 1641 #define BIAS 4 42 42 43 43 // returns the maximum number of processors the RWLock support … … 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 … … 352 352 353 353 #if !defined(__CFA_NO_STATISTICS__) 354 if(locali) { 355 __tls_stats()->ready.pick.pop.local++; 356 } 357 if(localj) { 354 if(locali && localj) { 358 355 __tls_stats()->ready.pick.pop.local++; 359 356 } … … 528 525 529 526 // Grow the ready queue 530 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 531 531 /* paranoid */ verify( ready_mutate_islocked() ); 532 532 __cfadbg_print_safe(ready_queue, "Kernel : Growing ready queue\n"); … … 543 543 // Find new count 544 544 // Make sure we always have atleast 1 list 545 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 } 546 552 547 553 // Allocate new array (uses realloc and memcpies the data) … … 578 584 579 585 /* paranoid */ verify( ready_mutate_islocked() ); 586 return preferred; 580 587 } 581 588
Note: See TracChangeset
for help on using the changeset viewer.