Proposal: replace readMVar with atomicReadMVar, breaking BC

Edward Z. Yang ezyang at MIT.EDU
Wed Jul 10 19:07:44 CEST 2013


Excerpts from Tom Murphy's message of Wed Jul 10 05:45:36 -0700 2013:
> Is there a reason why as I programmer I should prefer the non-FIFO
> semantics, or is it implemented that way for efficiency?

Timely delivery of reads.  Ordinary takeMVar is FIFO for fairness
reasons: so long as an MVar is not held indefinitely, all takeMVars
will be serviced.  For reads, we can service them immediately without
worrying about fairness, since they don't block anyone.

It is literally trivial to do either FIFO and non-FIFO implementation
wise.

Edward



More information about the Libraries mailing list