| Copyright | (C) 2015 Edward Kmett and Ted Cooper |
|---|---|
| License | BSD-style (see the file LICENSE) |
| Maintainer | Edward Kmett <ekmett@gmail.com>, Ted Cooper <anthezium@gmail.com> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Control.Concurrent.RCU.QSBR.Internal
Description
QSBR-based RCU
Synopsis
- newtype SRef s a = SRef {}
- data RCUThread s a = RCUThread {
- rcuThreadId :: !ThreadId
- rcuThreadVar :: !(MVar a)
- newtype RCU s a = RCU {}
- runRCU :: (forall s. RCU s a) -> IO a
- runOnRCU :: Int -> (forall s. RCU s a) -> IO a
- newtype ReadingRCU s a = ReadingRCU {
- runReadingRCU :: RCUState -> IO a
- newtype WritingRCU s a = WritingRCU {
- runWritingRCU :: RCUState -> IO a
- data RCUState = RCUState {
- rcuStateGlobalCounter :: !Counter
- rcuStateThreadCountersR :: !(IORef [Counter])
- rcuStateThreadCountersLockV :: !(MVar ())
- rcuStateWriterLockV :: !(MVar ())
- rcuStateMyCounter :: !Counter
- rcuStatePinned :: !(Maybe Int)
Documentation
Shared references
Instances
| MonadNew (SRef s) (RCU s) Source # | |
| MonadNew (SRef s) (ReadingRCU s) Source # | |
Defined in Control.Concurrent.RCU.QSBR.Internal Methods newSRef :: a -> ReadingRCU s (SRef s a) Source # | |
| MonadNew (SRef s) (WritingRCU s) Source # | |
Defined in Control.Concurrent.RCU.QSBR.Internal Methods newSRef :: a -> WritingRCU s (SRef s a) Source # | |
| MonadRCU (SRef s) (RCU s) Source # | |
| MonadReading (SRef s) (ReadingRCU s) Source # | |
Defined in Control.Concurrent.RCU.QSBR.Internal Methods readSRef :: SRef s a -> ReadingRCU s a Source # | |
| MonadReading (SRef s) (WritingRCU s) Source # | |
Defined in Control.Concurrent.RCU.QSBR.Internal Methods readSRef :: SRef s a -> WritingRCU s a Source # | |
| MonadWriting (SRef s) (WritingRCU s) Source # | |
Defined in Control.Concurrent.RCU.QSBR.Internal Methods writeSRef :: SRef s a -> a -> WritingRCU s () Source # synchronize :: WritingRCU s () Source # | |
| Eq (SRef s a) Source # | |
This is a basic RCU thread. It may be embellished when running in a more
exotic context.
Constructors
| RCUThread | |
Fields
| |
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.
Instances
| MonadIO (RCU s) Source # | |
Defined in Control.Concurrent.RCU.QSBR.Internal | |
| Applicative (RCU s) Source # | |
| Functor (RCU s) Source # | |
| Monad (RCU s) Source # | |
| MonadNew (SRef s) (RCU s) Source # | |
| MonadRCU (SRef s) (RCU s) Source # | |
| type Reading (RCU s) Source # | |
Defined in Control.Concurrent.RCU.QSBR.Internal | |
| type Thread (RCU s) Source # | |
Defined in Control.Concurrent.RCU.QSBR.Internal | |
| type Writing (RCU s) Source # | |
Defined in Control.Concurrent.RCU.QSBR.Internal | |
runOnRCU :: Int -> (forall s. RCU s a) -> IO a Source #
Run an RCU computation in a thread pinned to a particular core.
newtype ReadingRCU s a Source #
This is the basic read-side critical section for an RCU computation
Constructors
| ReadingRCU | |
Fields
| |
Instances
newtype WritingRCU s a Source #
This is the basic write-side critical section for an RCU computation
Constructors
| WritingRCU | |
Fields
| |
Instances
State for an RCU computation.
Constructors
| RCUState | |
Fields
| |