chaselev-deque- Chase & Lev work-stealing lock-free double-ended queues (deques).

Safe HaskellNone



Chase-Lev work stealing Deques

This implementation derives directly from the pseudocode in the 2005 SPAA paper:

TODO: local topBound optimization. TODO: Do the more optimized version of growCirc



pushL :: ChaseLevDeque a -> a -> IO () Source

For a work-stealing queue pushL is the ``local'' push. Thus only a single thread should perform this operation.

tryPopR :: ChaseLevDeque elt -> IO (Maybe elt) Source

This is the steal operation. Multiple threads may concurrently attempt steals from the same thread.

approxSize :: ChaseLevDeque elt -> IO Int Source

Return a lower bound on the size at some point in the recent past.