[Haskell-cafe] atomicModifyMutVar and casMutVar
tomberek at gmail.com
Wed Apr 25 15:38:48 CEST 2012
I have seen some push to take advantage of the new primop casMutVar, yet I
see that atomicModifyMutVar hasn't been used yet either. For example,
modifySTRef is just a read followed by a write. I've been unable to create
a version that does not allocate with something as simple as modifySTRef
There is a package Data.Ref.Unboxed that allows ST to use an unboxed
STURef, but even though I can see the Core using Int#, any use of
modifySTURef, or any version I've been able to make will excessively
box/rebox. Should I instead be using something like modifySTURef ref
(GHC.Prim.+#) or can this be automatically done by the compiler?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe