Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/ready_queue.cfa

    rbd0bdd37 r32c2c5e  
    3939#endif
    4040
    41 #define BIAS 4
     41#define BIAS 16
    4242
    4343// returns the maximum number of processors the RWLock support
     
    252252                preferred =
    253253                        //*
    254                         kernelTLS().this_processor ? kernelTLS().this_processor->cltr_id : -1;
     254                        kernelTLS().this_processor ? kernelTLS().this_processor->id * 4 : -1;
    255255                        /*/
    256256                        thrd->link.preferred * 4;
     
    330330        #if defined(BIAS)
    331331                // Don't bother trying locally too much
    332                 preferred = kernelTLS().this_processor->cltr_id;
     332                preferred = kernelTLS().this_processor->id * 4;
    333333        #endif
    334334
     
    352352
    353353                #if !defined(__CFA_NO_STATISTICS__)
    354                         if(locali && localj) {
     354                        if(locali) {
     355                                __tls_stats()->ready.pick.pop.local++;
     356                        }
     357                        if(localj) {
    355358                                __tls_stats()->ready.pick.pop.local++;
    356359                        }
     
    525528
    526529// Grow the ready queue
    527 unsigned ready_queue_grow(struct cluster * cltr, int target) {
    528         unsigned preferred;
    529         size_t ncount;
    530 
     530void ready_queue_grow  (struct cluster * cltr, int target) {
    531531        /* paranoid */ verify( ready_mutate_islocked() );
    532532        __cfadbg_print_safe(ready_queue, "Kernel : Growing ready queue\n");
     
    543543                // Find new count
    544544                // 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;
    552546
    553547                // Allocate new array (uses realloc and memcpies the data)
     
    584578
    585579        /* paranoid */ verify( ready_mutate_islocked() );
    586         return preferred;
    587580}
    588581
Note: See TracChangeset for help on using the changeset viewer.