atomicWriteIORef

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

atomicWriteIORef

David Feuer
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
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: atomicWriteIORef

Carter Schonwald
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 <[hidden email]> 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
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs