I conjecture, but might be wrong, that on a number of architectures, there isn't a native  CAS  plus memory ordering stuff? eg https://en.wikipedia.org/wiki/Memory_ordering

on the other hand, it might be a simple oversight (in which case good catch!)

i dont have SMP memory models properly digested well enough to say which though

On Fri, Jun 22, 2018 at 2:43 AM David Feuer <david.feuer@gmail.com> wrote:
Currently, atomicWriteIORef is implemented using atomicModifyIORef. That seems pretty heavy for the job, allocating closures and forcing thunks. Is there a reason not to do it with casMutVar#?
_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs