-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Open
Description
We currently have the following Synchronization "Primitives":
- Mutex: Rather efficient lock interacting with the scheduler
- Spinlock: Hot loop lock, May be Rank aware enforcing acquisition order
- WaitQueue: Not quite a condition variable, uses Blockers
- Blockers/BlockerSets: Similar to wait queues, but usually special purpose and support timeouts
Like for Futices, Thread joins or ARP routing
The main issues are as follows
- There is a special BigLock mutex, which is very broadly scoped and needs special handling in a lot of places
Ideally this should be removed (ongoing effort) - Blockers are not very well documented
- WaitQueue cannot virtually atomically unblock mutices or Spinlocks, which would make it a full CV
- The blocking code is quite old and crusty in some places, dancing with a lot of unranked Spinlocks
- Do we really need RecursiveSpinlocks in this many places
like why is a mutexes block list recursive-spinlock protected?
Missing (useful) Primitives may include
- proper Condition Variables (see above)
- Latches for tracking asynchronous HW task completion (Usually may also be doable with a CV and may CVs to work)
Metadata
Metadata
Assignees
Labels
No labels