-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Chase & Lev work-stealing lock-free double-ended queues (deques).
--   
--   A queue that is push/pop on one end and pop-only on the other. These
--   are commonly used for work-stealing. This implementation derives
--   directly from the pseudocode in the 2005 SPAA paper:
--   
--   
--   <a>http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.170.1097&amp;rep=rep1&amp;type=pdf</a>
@package chaselev-deque
@version 0.5.0.5


-- | Chase-Lev work stealing Deques
--   
--   This implementation derives directly from the pseudocode in the 2005
--   SPAA paper:
--   
--   
--   <a>http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.170.1097&amp;rep=rep1&amp;type=pdf</a>
--   
--   TODO: local topBound optimization. TODO: Do the more optimized version
--   of growCirc
module Data.Concurrent.Deque.ChaseLev
data ChaseLevDeque a
newQ :: IO (ChaseLevDeque elt)
nullQ :: ChaseLevDeque elt -> IO Bool

-- | For a work-stealing queue <a>pushL</a> is the `<tt>local'</tt> push.
--   Thus only a single thread should perform this operation.
pushL :: ChaseLevDeque a -> a -> IO ()
tryPopL :: ChaseLevDeque elt -> IO (Maybe elt)

-- | This is the steal operation. Multiple threads may concurrently attempt
--   steals from the same thread.
tryPopR :: ChaseLevDeque elt -> IO (Maybe elt)

-- | Return a lower bound on the size at some point in the recent past.
approxSize :: ChaseLevDeque elt -> IO Int
dbgInspectCLD :: Show a => ChaseLevDeque a -> IO String
instance Data.Concurrent.Deque.Class.DequeClass Data.Concurrent.Deque.ChaseLev.ChaseLevDeque
instance Data.Concurrent.Deque.Class.PopL Data.Concurrent.Deque.ChaseLev.ChaseLevDeque

module Data.Concurrent.Deque.ChaseLev.DequeInstance
