monad-par-0.3: A library for parallel programming based on a monad

Safe HaskellNone

Control.Monad.Par.Scheds.Direct

Description

A scheduler for the Par monad based on directly performing IO actions when Par methods are called (i.e. without using a lazy trace data structure).

Synopsis

Documentation

data Sched

Constructors

Sched 

Fields

no :: !Int
 
workpool :: WSDeque (Par ())
 
rng :: HotVar GenIO
 
isMain :: Bool
 
killflag :: HotVar Bool
 
idle :: HotVar [MVar Bool]
 
scheds :: [Sched]
 

Instances

MonadReader Sched Par 

data Par a

newtype IVar a

Constructors

IVar (IORef (IVarContents a)) 

data IVarContents a

Constructors

Full a 
Empty 
Blocked [a -> IO ()] 

runPar :: Par a -> a

new :: Par (IVar a)

creates a new IVar

get :: IVar a -> Par a

read the value in a IVar. The get can only return when the value has been written by a prior or parallel put to the same IVar.

put_ :: IVar a -> a -> Par ()

put_ is a version of put that is head-strict rather than fully-strict.

fork :: Par () -> Par ()

newFull :: NFData a => a -> Par (IVar a)

newFull_ :: a -> Par (IVar a)

put :: NFData a => IVar a -> a -> Par ()

spawn :: NFData a => Par a -> Par (IVar a)

spawn_ :: Par a -> Par (IVar a)

spawnP :: NFData a => a -> Par (IVar a)

spawn1_ :: (a -> Par b) -> a -> Par (IVar b)