Copyright | (C) 2015 Edward Kmett |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
- data SRef s a
- data RCU s a
- runRCU :: (forall s. RCU s a) -> IO a
- class Monad m => MonadNew s m | m -> s where
- class MonadNew s m => MonadReading s m | m -> s where
- class MonadReading s m => MonadWriting s m | m -> s where
- writeSRef :: SRef s a -> a -> m ()
- synchronize :: m ()
- class (MonadReading s (Reading m), MonadWriting s (Writing m), MonadNew s m) => MonadRCU s m | m -> s where
- data ReadingRCU s a
- data WritingRCU s a
- data RCUThread s a
Documentation
class Monad m => MonadNew s m | m -> s where Source
Nothing
MonadNew s (RCU s) Source | |
MonadNew s (WritingRCU s) Source | |
MonadNew s (ReadingRCU s) Source | |
MonadNew s m => MonadNew s (IdentityT m) Source | |
MonadNew s m => MonadNew s (MaybeT m) Source | |
MonadNew s m => MonadNew s (ExceptT e m) Source | |
MonadNew s' m => MonadNew s' (StateT s m) Source | |
MonadNew s' m => MonadNew s' (StateT s m) Source | |
(MonadNew s m, Monoid w) => MonadNew s (WriterT w m) Source | |
(MonadNew s m, Monoid w) => MonadNew s (WriterT w m) Source | |
MonadNew s m => MonadNew s (ReaderT e m) Source | |
(MonadNew s' m, Monoid w) => MonadNew s' (RWST r w s m) Source | |
(MonadNew s' m, Monoid w) => MonadNew s' (RWST r w s m) Source |
class MonadNew s m => MonadReading s m | m -> s where Source
This is a read-side critical section
Nothing
MonadReading s (WritingRCU s) Source | |
MonadReading s (ReadingRCU s) Source | |
MonadReading s m => MonadReading s (IdentityT m) Source | |
MonadReading s m => MonadReading s (MaybeT m) Source | |
MonadReading s m => MonadReading s (ExceptT e m) Source | |
MonadReading s' m => MonadReading s' (StateT s m) Source | |
MonadReading s' m => MonadReading s' (StateT s m) Source | |
(MonadReading s m, Monoid w) => MonadReading s (WriterT w m) Source | |
(MonadReading s m, Monoid w) => MonadReading s (WriterT w m) Source | |
MonadReading s m => MonadReading s (ReaderT e m) Source | |
(MonadReading s' m, Monoid w) => MonadReading s' (RWST r w s m) Source | |
(MonadReading s' m, Monoid w) => MonadReading s' (RWST r w s m) Source |
class MonadReading s m => MonadWriting s m | m -> s where Source
This is a write-side critical section
Nothing
writeSRef :: SRef s a -> a -> m () Source
Write to a shared reference.
synchronize :: m () Source
Synchronize with other writers.
No other writer can straddle this time bound. It will either see writes from before, or writes after, but never some of both!
MonadWriting s (WritingRCU s) Source | |
MonadWriting s m => MonadWriting s (MaybeT m) Source | |
MonadWriting s m => MonadWriting s (IdentityT m) Source | |
MonadWriting s m => MonadWriting s (ExceptT e m) Source | |
MonadWriting s m => MonadWriting s (StateT s m) Source | |
MonadWriting s m => MonadWriting s (StateT s m) Source | |
(MonadWriting s m, Monoid w) => MonadWriting s (WriterT w m) Source | |
(MonadWriting s m, Monoid w) => MonadWriting s (WriterT w m) Source | |
MonadWriting s m => MonadWriting s (ReaderT e m) Source | |
(MonadWriting s m, Monoid w) => MonadWriting s (RWST r w s m) Source | |
(MonadWriting s m, Monoid w) => MonadWriting s (RWST r w s m) Source |
class (MonadReading s (Reading m), MonadWriting s (Writing m), MonadNew s m) => MonadRCU s m | m -> s where Source
This is the executor service that can fork, join and execute critical sections.
type Reading m :: * -> * Source
A read-side critical section
type Writing m :: * -> * Source
A write-side critical section
type Thread m :: * -> * Source
Threads we can fork and join
forking :: m a -> m (Thread m a) Source
Fork a thread
joining :: Thread m a -> m a Source
Join a thread
reading :: Reading m a -> m a Source
Run a read-side critical section
writing :: Writing m a -> m a Source
Run a write-side critical section
MonadRCU s (RCU s) Source | |
MonadRCU s m => MonadRCU s (MaybeT m) Source | |
MonadRCU s m => MonadRCU s (IdentityT m) Source | |
(MonadRCU s m, Monoid e) => MonadRCU s (WriterT e m) Source | |
(MonadRCU s m, Monoid e) => MonadRCU s (WriterT e m) Source | |
MonadRCU s m => MonadRCU s (ExceptT e m) Source | |
MonadRCU s m => MonadRCU s (ReaderT e m) Source |
Implementation Details
data ReadingRCU s a Source
This is the basic read-side critical section for an RCU computation
MonadReading s (ReadingRCU s) Source | |
MonadNew s (ReadingRCU s) Source | |
Monad (ReadingRCU s) Source | |
Functor (ReadingRCU s) Source | |
Applicative (ReadingRCU s) Source |
data WritingRCU s a Source
This is the basic write-side critical section for an RCU computation
MonadWriting s (WritingRCU s) Source | |
MonadReading s (WritingRCU s) Source | |
MonadNew s (WritingRCU s) Source | |
Monad (WritingRCU s) Source | |
Functor (WritingRCU s) Source | |
Applicative (WritingRCU s) Source | |
Alternative (WritingRCU s) Source | |
MonadPlus (WritingRCU s) Source |