Changeset 5f6a172 for libcfa


Ignore:
Timestamp:
Apr 16, 2021, 2:01:27 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
c8a0210, e54d0c3
Parents:
6528d75
Message:

Fix assertions on ready_queue with workstealling

File:
1 edited

Legend:

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

    r6528d75 r5f6a172  
    4444        #define BIAS 4
    4545        #define READYQ_SHARD_FACTOR 4
     46        #define SEQUENTIAL_SHARD 1
    4647#elif defined(USE_WORK_STEALING)
    4748        #define READYQ_SHARD_FACTOR 2
     49        #define SEQUENTIAL_SHARD 2
    4850#else
    4951        #error no scheduling strategy selected
     
    216218
    217219void ^?{}(__ready_queue_t & this) with (this) {
    218         verify( 1 == lanes.count );
     220        verify( SEQUENTIAL_SHARD == lanes.count );
    219221        free(lanes.data);
    220222        free(lanes.tscs);
     
    614616                        ncount = target * READYQ_SHARD_FACTOR;
    615617                } else {
    616                         ncount = 1;
     618                        ncount = SEQUENTIAL_SHARD;
    617619                }
    618620
     
    662664                // Find new count
    663665                // Make sure we always have atleast 1 list
    664                 lanes.count = target >= 2 ? target * READYQ_SHARD_FACTOR: 1;
     666                lanes.count = target >= 2 ? target * READYQ_SHARD_FACTOR: SEQUENTIAL_SHARD;
    665667                /* paranoid */ verify( ocount >= lanes.count );
    666668                /* paranoid */ verify( lanes.count == target * READYQ_SHARD_FACTOR || target < 2 );
Note: See TracChangeset for help on using the changeset viewer.