Proposal: replace readMVar with atomicReadMVar, breaking BC

Joey Adams joeyadams3.14159 at
Thu Jul 11 06:13:37 CEST 2013

+1 for changing readMVar to be atomic, but we should probably mention the
change in the doc for readMVar, something like the following (perhaps in
fewer words):

    -- | ...
    -- /Compatibility note:/ prior to base 4.7, 'readMVar' was a combination
    -- of 'takeMVar' and 'putMVar', resulting in two drawbacks:
    --  * 'readMVar' was not atomic in the presence of multiple producers.
    --    Between taking the value and putting it back, another thread
    --    calling 'putMVar' could win, causing 'readMVar' to block after
    --    retrieving a value.
    -- * 'readMVar' was not multiple wakeup, meaning each consumer had to
    --   wake up the next.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list