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

Safe HaskellNone

Control.Concurrent.Bag.Implicit

Synopsis

Documentation

newTaskBagSource

Arguments

:: TaskBufferSTM b 
=> Maybe (SplitFunction b r)

Possible split function If the function is given, we will create a bag with one buffer per worker reducing the communication between the workers.

-> [Task b r (Maybe r)]

list of initial tasks

-> IO [r] 

newEvalBag :: TaskBufferSTM b => Maybe (SplitFunction b r) -> [r] -> IO [r]Source

Like newTaskBag, but it takes a list of expressions that will be evaluated to weak head normal form using seq.

__WARNING__: This does not evaluate to normal form, but only to weak head normal form.

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