diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2016-03-28 14:52:35 +0200 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-03-29 12:37:57 +0200 |
commit | 0f0c1387882be6a19af2cf3e6a005d70a3e84ae7 (patch) | |
tree | ff5eb439395e21fe0e0e08597355de7110fe2531 | |
parent | a658ad9f5b9849296ac25225174dac6a700a235e (diff) | |
download | haskell-0f0c1387882be6a19af2cf3e6a005d70a3e84ae7.tar.gz |
base: Document caveats about Control.Concurrent.Chan
These are implemented using `MVars` which have known caveats. Suggest
the use of `TChan` from the stm library instead.
Test Plan: n/a
Reviewers: austin, hvr, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2047
-rw-r--r-- | libraries/base/Control/Concurrent/Chan.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libraries/base/Control/Concurrent/Chan.hs b/libraries/base/Control/Concurrent/Chan.hs index f5785f5a65..ed8e02bed4 100644 --- a/libraries/base/Control/Concurrent/Chan.hs +++ b/libraries/base/Control/Concurrent/Chan.hs @@ -14,6 +14,11 @@ -- -- Unbounded channels. -- +-- The channels are implemented with @MVar@s and therefore inherit all the +-- caveats that apply to @MVar@s (possibility of races, deadlocks etc). The +-- stm (software transactional memory) library has a more robust implementation +-- of channels called @TChan@s. +-- ----------------------------------------------------------------------------- module Control.Concurrent.Chan |