dph-prim-par-0.7.0.1: Data Parallel Haskell segmented arrays. (production version)

Safe HaskellNone

Data.Array.Parallel.Unlifted.Distributed.Primitive.Gang

Description

Gang primitives.

Synopsis

Documentation

data Gang Source

A Gang is a group of threads which execute arbitrary work requests.

Instances

data Workload Source

Constructors

WorkUnknown

Unknown workload. Just run it in parallel.

WorkCopy Int

Memory bound copy-like workload, of the given number of bytes.

Instances

seqGang :: Gang -> GangSource

A sequential gang has no threads.

forkGang :: Int -> IO GangSource

Fork a Gang with the given number of threads (at least 1).

gangSize :: Gang -> IntSource

O(1). Yield the number of threads in the Gang.

gangIO :: Gang -> String -> Workload -> (Int -> IO ()) -> IO ()Source

Issue work requests for the Gang and wait until they have been executed. If the gang is already busy then just run the action in the requesting thread.

gangST :: Gang -> String -> Workload -> (Int -> ST s ()) -> ST s ()Source

Same as gangIO but in the ST monad.