| 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 | None |
| Language | Haskell2010 |
Control.Concurrent.RCU.QSBR.Internal
Description
QSBR-based RCU
- 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
| MonadRCU (SRef s) (RCU s) Source # | |
| MonadWriting (SRef s) (WritingRCU s) Source # | |
| MonadReading (SRef s) (WritingRCU s) Source # | |
| MonadReading (SRef s) (ReadingRCU s) Source # | |
| MonadNew (SRef s) (RCU s) Source # | |
| MonadNew (SRef s) (WritingRCU s) Source # | |
| MonadNew (SRef s) (ReadingRCU 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
| |
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
| Monad (ReadingRCU s) Source # | |
| Functor (ReadingRCU s) Source # | |
| Applicative (ReadingRCU s) Source # | |
| Alternative (ReadingRCU s) Source # | |
| MonadPlus (ReadingRCU s) Source # | |
| MonadReading (SRef s) (ReadingRCU s) Source # | |
| MonadNew (SRef s) (ReadingRCU s) Source # | |
newtype WritingRCU s a Source #
This is the basic write-side critical section for an RCU computation
Constructors
| WritingRCU | |
Fields
| |
Instances
| Monad (WritingRCU s) Source # | |
| Functor (WritingRCU s) Source # | |
| Applicative (WritingRCU s) Source # | |
| Alternative (WritingRCU s) Source # | |
| MonadPlus (WritingRCU s) Source # | |
| MonadWriting (SRef s) (WritingRCU s) Source # | |
| MonadReading (SRef s) (WritingRCU s) Source # | |
| MonadNew (SRef s) (WritingRCU s) Source # | |
State for an RCU computation.
Constructors
| RCUState | |
Fields
| |