HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulelockfree-queue-0.2.4Haskell2010

Data.Concurrent.Queue.MichaelScott

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

Synopsis
valuepushL :: LinkedQueue a -> a -> IO ()

Push a new element onto the queue. Because the queue can grow, this always succeeds.

valuetryPopR :: LinkedQueue a -> IO (Maybe a)

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.