monad-par-0.3.4.6: 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 Source

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 Source

Constructors

IVar (IORef (IVarContents a)) 

data IVarContents a Source

Constructors

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

runPar :: Par a -> aSource

new :: Par (IVar a)Source

creates a new IVar

get :: IVar a -> Par aSource

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 ()Source

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 ()Source

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

newFull_ :: a -> Par (IVar a)Source

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

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

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

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

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