Proposal: replace readMVar with atomicReadMVar, breaking BC

David Luposchainsky dluposchainsky at googlemail.com
Thu Jul 11 10:57:28 CEST 2013


On 2013-07-10 11:20, Edward Z. Yang wrote:
> GHC HEAD recently got a new primitive: atomicReadMVar#, which allows you
> to read MVars without first taking and then putting back (removing a
> nasty race where readMVar only works properly when there are no waiting
> putters).

+1

I avoided readMVar for that reason in the past, effectively doing the
take/put manually. I agree with others that the atomic operation is the
desired behavior.

David




More information about the Libraries mailing list