Proposal: replace readMVar with atomicReadMVar, breaking BC

amindfv at gmail.com amindfv at gmail.com
Thu Jul 11 02:24:04 CEST 2013


+1 definitely.

Tom


El Jul 10, 2013, a las 13:07, "Edward Z. Yang" <ezyang at MIT.EDU> escribió:

> 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