waitfree-0.0: A wrapping library for waitfree comnputation.

Control.Concurrent.Waitfree

Synopsis

Documentation

data ZeroT Source

Instances

data SucT t Source

'SucT t' is a Thread if t is a Thread. The name SucT comes from the successor function.

Instances

Thread t => Thread (SucT t) 

data HNil Source

HNil is the empty HyperSequent

Instances

Lconvertible HNil 
HyperSequent HNil 
HyperSequent l => HAppend HNil l l 

data HCons e l Source

'HCons (K t e)' adds a remote computation in front of a HyperSequent

Instances

(Thread t, Lconvertible l) => Lconvertible (HCons (K t a) l) 
HyperSequent l => HyperSequent (HCons (K t e) l) 
(HyperSequent l, HAppend l l' l'') => HAppend (HCons x l) l' (HCons x l'') 

type :*: e l = HCons e lSource

an abreviation for HCons

data K t a Source

A value of type 'K t a' represents a remote computation returning a that is performed by a thread t.

Instances

(Thread t, Lconvertible l) => Lconvertible (HCons (K t a) l) 
HyperSequent l => HyperSequent (HCons (K t e) l) 

single :: Thread t => IO a -> Hyp (K t a :*: HNil)Source

single creates a Hyp hypersequent consisting of a single remote computation.

data Hyp a Source

hypersequent is always put in Hyp monad

Instances

class Thread t whereSource

An abstract representation of a thread. Threads are actually implemented using forkIO.

Instances

peek :: Thread t => (t -> Maybe a -> IO b) -> K t a -> IO bSource

peek allows to look at the result of a remote computation

comm :: (Thread s, Thread t, HAppend l l' l'') => Hyp (HCons (K t (b, a)) l) -> Hyp (HCons (K s (d, c)) l') -> Hyp (K t (b, c) :*: (K s (d, a) :*: l''))Source

comm stands for communication. comm combines two hypersequents with a communicating component from each hypersequent.

execute :: Lconvertible l => Hyp l -> IO ()Source

execute executes a Hyp hypersequent.

(-*-) :: (Thread t, HyperSequent l, HyperSequent l') => (K t a -> IO (Maybe b)) -> (l -> Hyp l') -> HCons (K t a) l -> Hyp (HCons (K t b) l')Source

extend a Hyp hypersequent with another computation