diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2014-01-29 22:05:47 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2014-01-29 22:09:23 +0100 |
commit | fcf0294b443622850cc2e3aac06d0da053c2636b (patch) | |
tree | b48fcb7759df6766f5568e1ea319906e97b781b0 /libraries/base/Control/Concurrent | |
parent | cfa01595636e3eb439a07b51a94ef33cb86fc50e (diff) | |
download | haskell-fcf0294b443622850cc2e3aac06d0da053c2636b.tar.gz |
Improve Haddock markup in `Control.Concurrent.MVar`
This adds a labeled hyperlink to the Concurrent Haskell paper, and
replaces the itemized-list headings with proper section
headings (available since Haddock-2.14).
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Diffstat (limited to 'libraries/base/Control/Concurrent')
-rw-r--r-- | libraries/base/Control/Concurrent/MVar.hs | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/libraries/base/Control/Concurrent/MVar.hs b/libraries/base/Control/Concurrent/MVar.hs index 590872979d..c988c626d6 100644 --- a/libraries/base/Control/Concurrent/MVar.hs +++ b/libraries/base/Control/Concurrent/MVar.hs @@ -24,12 +24,14 @@ -- 3. As a binary semaphore @'MVar' ()@, with 'takeMVar' and 'putMVar' as -- wait and signal. -- --- They were introduced in the paper "Concurrent Haskell" by Simon --- Peyton Jones, Andrew Gordon and Sigbjorn Finne, though some details --- of their implementation have since then changed (in particular, a --- put on a full MVar used to error, but now merely blocks.) +-- They were introduced in the paper +-- <http://research.microsoft.com/~simonpj/papers/concurrent-haskell.ps.gz "Concurrent Haskell"> +-- by Simon Peyton Jones, Andrew Gordon and Sigbjorn Finne, though +-- some details of their implementation have since then changed (in +-- particular, a put on a full 'MVar' used to error, but now merely +-- blocks.) -- --- * Applicability +-- === Applicability -- -- 'MVar's offer more flexibility than 'IORef's, but less flexibility -- than 'STM'. They are appropriate for building synchronization @@ -47,7 +49,7 @@ -- perform a 'takeMVar' before a 'putMVar' as well; otherwise, they may -- block. -- --- * Fairness +-- === Fairness -- -- No thread can be blocked indefinitely on an 'MVar' unless another -- thread holds that 'MVar' indefinitely. One usual implementation of @@ -55,7 +57,7 @@ -- served in a first-in-first-out fashion, but this is not guaranteed -- in the semantics. -- --- * Gotchas +-- === Gotchas -- -- Like many other Haskell data structures, 'MVar's are lazy. This -- means that if you place an expensive unevaluated thunk inside an @@ -64,14 +66,14 @@ -- in an 'MVar' to the appropriate normal form, or utilize a strict -- MVar provided by the strict-concurrency package. -- --- * Ordering +-- === Ordering -- -- 'MVar' operations are always observed to take place in the order -- they are written in the program, regardless of the memory model of -- the underlying machine. This is in contrast to 'IORef' operations -- which may appear out-of-order to another thread in some cases. -- --- * Example +-- === Example -- -- Consider the following concurrent data structure, a skip channel. -- This is a channel for an intermittent source of high bandwidth |