Ignore:
Timestamp:
Aug 14, 2020, 3:12:02 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
dcb5f8d
Parents:
7fdae38
Message:

Changed eager submit to use a leader-lock rather than a regular spinlock to avoid unnecessary spinnig

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/io/types.hfa

    r7fdae38 r2fafe7e  
    2222
    2323      #include "bits/locks.hfa"
     24
     25        #define LEADER_LOCK
     26        struct __leaderlock_t {
     27                struct $thread * volatile value;        // ($thread) next_leader | (bool:1) is_locked
     28        };
     29
     30        static inline void ?{}( __leaderlock_t & this ) { this.value = 0p; }
    2431
    2532        //-----------------------------------------------------------------------
     
    4956                __u32 ready_cnt;
    5057
    51                 __spinlock_t lock;
    52                 __spinlock_t release_lock;
     58                #if defined(LEADER_LOCK)
     59                        __leaderlock_t submit_lock;
     60                #else
     61                        __spinlock_t submit_lock;
     62                #endif
     63                __spinlock_t  release_lock;
    5364
    5465                // A buffer of sqes (not the actual ring)
Note: See TracChangeset for help on using the changeset viewer.