Instances1DequeClass
DequeClass LinkedQueueDefined in lockfree-queue-0.2.4 · Data.Concurrent.Queue.MichaelScott
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
Modulelockfree-queue-0.2.4Haskell2010
Michael and Scott lock-free, single-ended queues.
This is a straightforward implementation of classic Michael & Scott Queues. Pseudocode for this algorithm can be found here:
http://www.cs.rochester.edu/research/synchronization/pseudocode/queues.html
DequeClass LinkedQueueDefined in lockfree-queue-0.2.4 · Data.Concurrent.Queue.MichaelScottCreate a new queue.
Is the queue currently empty? Beware that this can be a highly transient state.
Push a new element onto the queue. Because the queue can grow, this always succeeds.
Attempt to pop an element from the queue if one is available. tryPop will return semi-promptly (depending on contention), but will return Nothing if the queue is empty.