[commit: ghc] master: base: Document caveats about Control.Concurrent.Chan (0f0c138)
git at git.haskell.org
git at git.haskell.org
Tue Mar 29 10:35:30 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/0f0c1387882be6a19af2cf3e6a005d70a3e84ae7/ghc
>---------------------------------------------------------------
commit 0f0c1387882be6a19af2cf3e6a005d70a3e84ae7
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date: Mon Mar 28 14:52:35 2016 +0200
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
>---------------------------------------------------------------
0f0c1387882be6a19af2cf3e6a005d70a3e84ae7
libraries/base/Control/Concurrent/Chan.hs | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libraries/base/Control/Concurrent/Chan.hs b/libraries/base/Control/Concurrent/Chan.hs
index f5785f5..ed8e02b 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 at s and therefore inherit all the
+-- caveats that apply to @MVar at s (possibility of races, deadlocks etc). The
+-- stm (software transactional memory) library has a more robust implementation
+-- of channels called @TChan at s.
+--
-----------------------------------------------------------------------------
module Control.Concurrent.Chan
More information about the ghc-commits
mailing list