gang-of-threads-0.0.2: Non-deterministic parallelism with bags

Safe HaskellSafe-Inferred

Control.Concurrent.Bag.TaskBuffer

Documentation

class TaskBufferSTM b whereSource

Methods

newBufferSTM :: STM (b a)Source

writeBufferSTM :: b a -> a -> STM ()Source

unGetBufferSTM :: b a -> a -> STM ()Source

Put the data back into the buffer. The item will be the next item read.

readBufferSTM :: b a -> STM aSource

tryReadBufferSTM :: b a -> STM (Maybe a)Source

isEmptyBufferSTM :: b a -> STM BoolSource

splitVertical :: SplitFunction b rSource

splitHalf :: SplitFunction b rSource

type SplitFunction b r = b (IO (Maybe r)) -> b (IO (Maybe r)) -> STM (IO (Maybe r))Source

takeFirst :: TaskBufferSTM b => b (IO (Maybe r)) -> b (IO (Maybe r)) -> STM (IO (Maybe r))Source