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

Safe HaskellNone

Control.Concurrent.Bag.Implicit

Synopsis

Documentation

newTaskBagSource

Arguments

:: BufferType 
-> Maybe (SplitFunction 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.

-> [TaskIO r (Maybe r)]

list of initial tasks

-> IO [r] 

newEvalBag :: BufferType -> Maybe (SplitFunction 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.

newInterruptingBag :: BufferType -> Maybe (SplitFunction r) -> [Interruptible r] -> IO [r]Source

Similar to newTaskBag, but interrupts the tasks in certain intervals. Using a TChan as buffer, this ensures completeness: all tasks that have a result will get their time to evaluate it. Note, that calculations, that do no memory allocation, cannot be interrupted.

data BufferType Source

Constructors

Queue 
Stack