-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Michael and Scott lock-free queues. -- @package lockfree-queue @version 0.2.3.1 -- | 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 module Data.Concurrent.Queue.MichaelScott data LinkedQueue a -- | Create a new queue. newQ :: IO (LinkedQueue a) -- | Is the queue currently empty? Beware that this can be a highly -- transient state. nullQ :: LinkedQueue a -> IO Bool -- | Push a new element onto the queue. Because the queue can grow, this -- always succeeds. pushL :: LinkedQueue a -> a -> IO () -- | 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. tryPopR :: LinkedQueue a -> IO (Maybe a) instance DequeClass LinkedQueue module Data.Concurrent.Queue.MichaelScott.DequeInstance