Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Data.Concurrent.Deque.Reference
Description
A strawman implementation of concurrent Dequeues. This implementation is so simple that it also makes a good reference implementation for debugging.
The queue representation is simply an IORef containing a Data.Sequence.
Also see Data.Concurrent.Deque.Reference.DequeInstance. By convention a module of this name is also provided.
- data SimpleDeque elt = DQ !Int !(IORef (Seq elt))
- newQ :: IO (SimpleDeque elt)
- nullQ :: SimpleDeque elt -> IO Bool
- newBoundedQ :: Int -> IO (SimpleDeque elt)
- pushL :: SimpleDeque t -> t -> IO ()
- pushR :: SimpleDeque t -> t -> IO ()
- tryPopR :: SimpleDeque a -> IO (Maybe a)
- tryPopL :: SimpleDeque a -> IO (Maybe a)
- tryPushL :: SimpleDeque a -> a -> IO Bool
- tryPushR :: SimpleDeque a -> a -> IO Bool
- _is_using_CAS :: Bool
Documentation
newQ :: IO (SimpleDeque elt) #
nullQ :: SimpleDeque elt -> IO Bool #
newBoundedQ :: Int -> IO (SimpleDeque elt) #
pushL :: SimpleDeque t -> t -> IO () #
pushR :: SimpleDeque t -> t -> IO () #
tryPopR :: SimpleDeque a -> IO (Maybe a) #
tryPopL :: SimpleDeque a -> IO (Maybe a) #
tryPushL :: SimpleDeque a -> a -> IO Bool #
tryPushR :: SimpleDeque a -> a -> IO Bool #
_is_using_CAS :: Bool #