base: Document caveats about Control.Concurrent.Chan
authorErik de Castro Lopo <erikd@mega-nerd.com>
Mon, 28 Mar 2016 12:52:35 +0000 (14:52 +0200)
committerBen Gamari <ben@smart-cactus.org>
Tue, 29 Mar 2016 10:37:57 +0000 (12:37 +0200)
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

libraries/base/Control/Concurrent/Chan.hs

index f5785f5..ed8e02b 100644 (file)
 --
 -- 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