MVar -is:module
An
MVar (pronounced "em-var") is a synchronising variable, used
for communication between concurrent threads. It can be thought of as
a box, which may be empty or full.
A synchronizing variable, used for communication between concurrent
threads. It can be thought of as a box, which may be empty or full.
An
MVar (pronounced "em-var") is a synchronising variable, used
for communication between concurrent threads. It can be thought of as
a box, which may be empty or full.
An
MVar (pronounced "em-var") is a synchronising variable, used
for communication between concurrent threads. It can be thought of as
a a box, which may be empty or full.
A shared mutable variable (
not the same as a
MutVar#!).
(Note: in a non-concurrent implementation,
(MVar# a)
can be represented by
(MutVar# (Maybe a)).)
An MVar#, with a queue of thread state objects blocking on
them
Strict (WHNF) version of
MVar.
Every MVar has a unique identifier.
Every MVar has a unique identifier.
Take the
MVar before and put it back after.
Run the
StateT on an
MVar, taking the initial state and
putting the final state.
Not on Stackage, so not searched.
A trivial lock based on MVar
Check whether a given
MVar is empty.
Notice that the boolean value returned is just a snapshot of the state
of the MVar. By the time you get to react on its result, the MVar may
have been filled (or emptied) - so be extremely careful when using
this operation. Use
tryTakeMVar instead if possible.