
10 Jul
2013
10 Jul
'13
1:21 p.m.
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
Great, thanks a lot!
The general feeling Simon and I have is that everyone really wanted to make believe readMVar was atomicReadMVar, and so maybe we should break BC and make readMVar do the right thing.
I agree completely. In my experience, the current non-atomic behaviour of readMVar has only lead to confusion; I don't see any use for this behaviour. Besides, if anybody really wants that behaviour they should probably invoke takeMVar and putMVar separately and add a comment or two. I also agree with the reasoning behind processing atomicReadMVar eagerly. Best regards, Bertram