- File:
-
- 1 edited
-
libcfa/src/concurrency/ready_queue.cfa (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/ready_queue.cfa
rbd0bdd37 r32c2c5e 39 39 #endif 40 40 41 #define BIAS 441 #define BIAS 16 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-> cltr_id: -1;254 kernelTLS().this_processor ? kernelTLS().this_processor->id * 4 : -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-> cltr_id;332 preferred = kernelTLS().this_processor->id * 4; 333 333 #endif 334 334 … … 352 352 353 353 #if !defined(__CFA_NO_STATISTICS__) 354 if(locali && localj) { 354 if(locali) { 355 __tls_stats()->ready.pick.pop.local++; 356 } 357 if(localj) { 355 358 __tls_stats()->ready.pick.pop.local++; 356 359 } … … 525 528 526 529 // Grow the ready queue 527 unsigned ready_queue_grow(struct cluster * cltr, int target) { 528 unsigned preferred; 529 size_t ncount; 530 530 void ready_queue_grow (struct cluster * cltr, int target) { 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 if(target >= 2) { 546 ncount = target * 4; 547 preferred = ncount - 4; 548 } else { 549 ncount = 1; 550 preferred = 0; 551 } 545 size_t ncount = target >= 2 ? target * 4: 1; 552 546 553 547 // Allocate new array (uses realloc and memcpies the data) … … 584 578 585 579 /* paranoid */ verify( ready_mutate_islocked() ); 586 return preferred;587 580 } 588 581
Note:
See TracChangeset
for help on using the changeset viewer.