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

Safe HaskellNone
LanguageHaskell98

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
 
sessions :: HotVar [Session]
 
idle :: HotVar [MVar Bool]
 
scheds :: [Sched]
 
activeSessions :: HotVar (Set SessionID)
 
sessionCounter :: HotVar SessionID
 

Instances

newtype IVar a

Constructors

IVar (IORef (IVarContents a)) 

Instances

NFData (IVar a) 

data IVarContents a

Constructors

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

runPar :: Par a -> a

runParIO :: Par a -> IO a

new :: Par (IVar a)

Creates a new IVar

get :: IVar a -> Par a

Read the value in an IVar. The get operation 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. In this scheduler, puts immediately execute woken work in the current thread.

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)