waitfree-0.1.3: A wrapping library for waitfree computation.

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

comm :: (Thread s, Thread t, HAppend l l' l'') => Hyp (HCons (K t (b, a)) l) -> (t -> b -> IO ()) -> Hyp (HCons (K s (d, c)) l') -> (s -> d -> IO ()) -> 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. | 'comm hypersequent1 error1 hypersequent2 error2' where error1 and error2 specifies what to do in case of read failure.

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

execute executes a Hyp hypersequent.

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

extend a Hyp hypersequent with another computation