-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Michael and Scott lock-free queues.
--
-- Michael and Scott queues are described in their PODC 1996 paper:
--
-- http://dl.acm.org/citation.cfm?id=248052.248106
--
-- These are single-ended concurrent queues based on a singlly linked
-- list and using atomic CAS instructions to swap the tail pointers. As a
-- well-known efficient algorithm they became the basis for Java's
-- ConcurrentLinkedQueue.
@package lockfree-queue
@version 0.2.0.2
-- | 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