
11 Jul
2013
11 Jul
'13
8:57 a.m.
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