Ignore:
Timestamp:
Mar 18, 2022, 12:42:39 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
0b4ddb71, 51239d1b
Parents:
3bc69f2
Message:

Tentative fix for spurious deadlock in some concurrency tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel.hfa

    r3bc69f2 r22226e4  
    4848extern struct cluster * mainCluster;
    4949
    50 // Processor id, required for scheduling threads
    51 
    52 
     50// Coroutine used py processors for the 2-step context switch
    5351coroutine processorCtx_t {
    5452        struct processor * proc;
    5553};
    5654
    57 
     55struct io_future_t;
     56
     57// Information needed for idle sleep
    5858struct __fd_waitctx {
    59         volatile int fd;
     59        // semaphore/future like object
     60        // values can be 0, 1 or some file descriptor.
     61        // 0 - is the default state
     62        // 1 - means the proc should wake-up immediately
     63        // FD - means the proc is going asleep and should be woken by writing to the FD.
     64        volatile int sem;
     65
     66        // The event FD that corresponds to this processor
     67        int evfd;
     68
     69        // buffer into which the proc will read from evfd
     70        // unused if not using io_uring for idle sleep
     71        void * rdbuf;
     72
     73        // future use to track the read of the eventfd
     74        // unused if not using io_uring for idle sleep
     75        io_future_t * ftr;
    6076};
    6177
     
    103119        bool pending_preemption;
    104120
    105         // Idle lock (kernel semaphore)
    106         int idle_fd;
    107 
    108         // Idle waitctx
     121        // context for idle sleep
    109122        struct __fd_waitctx idle_wctx;
    110123
     
    168181        volatile unsigned id;
    169182};
    170 
    171 // //TODO adjust cache size to ARCHITECTURE
    172 // // Structure holding the ready queue
    173 // struct __ready_queue_t {
    174 //      // Data tracking the actual lanes
    175 //      // On a seperate cacheline from the used struct since
    176 //      // used can change on each push/pop but this data
    177 //      // only changes on shrink/grow
    178 //      struct {
    179 //              // Arary of lanes
    180 //              __intrusive_lane_t * volatile data;
    181 
    182 //              __cache_id_t * volatile caches;
    183 
    184 //              // Number of lanes (empty or not)
    185 //              volatile size_t count;
    186 //      } lanes;
    187 // };
    188 
    189 // void  ?{}(__ready_queue_t & this);
    190 // void ^?{}(__ready_queue_t & this);
    191183
    192184// Idle Sleep
Note: See TracChangeset for help on using the changeset viewer.