rcu-0.1: Read-Copy-Update for Haskell

Copyright(C) 2015 Edward Kmett and Ted Cooper
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>, Ted Cooper <anthezium@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Control.Concurrent.RCU.QSBR.Internal

Description

QSBR-based RCU

Synopsis

Documentation

newtype SRef s a Source

Shared references

Constructors

SRef 

Fields

unSRef :: IORef a
 

data RCUThread s a Source

This is a basic RCU thread. It may be embellished when running in a more exotic context.

Constructors

RCUThread 

Fields

rcuThreadId :: !ThreadId
 
rcuThreadVar :: !(MVar a)
 

newtype RCU s a Source

This is an RCU computation. It can use forking and joining to form new threads, and then you can use reading and writing to run classic read-side and write-side RCU computations. Writers are serialized using an MVar, readers are able to proceed while writers are updating.

Constructors

RCU 

Fields

unRCU :: RCUState -> IO a
 

runRCU :: (forall s. RCU s a) -> IO a Source

Run an RCU computation.

newtype ReadingRCU s a Source

This is the basic read-side critical section for an RCU computation

Constructors

ReadingRCU 

Fields

runReadingRCU :: RCUState -> IO a
 

newtype WritingRCU s a Source

This is the basic write-side critical section for an RCU computation

Constructors

WritingRCU 

Fields

runWritingRCU :: RCUState -> IO a
 

data RCUState Source

State for an RCU computation.

Constructors

RCUState 

Fields

rcuStateGlobalCounter :: !Counter
 
rcuStateMyCounter :: !Counter
 
rcuStateThreadCountersV :: !(MVar [Counter])
 
rcuStateWriterLockV :: !(MVar ())