Expand description
Lock-Free MPSC Queue
A wait-free multi-producer, single-consumer queue using atomic operations. Designed for the scheduler ready queue where multiple CPUs may enqueue tasks concurrently while only the owning CPU dequeues.
Implementation uses a Michael-Scott style linked list with AtomicPtr:
- Enqueue: CAS on tail pointer (lock-free, linearizable)
- Dequeue: CAS on head pointer (lock-free, single consumer)
- Memory reclamation via hazard pointers
This queue is cache-line padded to avoid false sharing between the head and tail pointers on different CPUs.
Structs§
- Lock
Free Queue - A lock-free multi-producer, single-consumer queue.