atomicity and visibility of readIORef / writeIORef

Hello haskellers, is there any guarantees of atomicity and visibility of read-write operations on IORefs, like Java have for volatile variables?

Check https://hackage.haskell.org/package/base-4.8.1.0/docs/Data-IORef.html: "An atomicModifyIORef is never observed to take place ahead of any earlier (in program order) IORef operations, or after any later IORef operations." There are atomic variants of write/modifyIORef which place an appropriate memory barrier so that race conditions (like in the example on the bottom of the page) can't happen. On 8/2/2015 2:09 PM, Alexey Egorov wrote:
Hello haskellers,
is there any guarantees of atomicity and visibility of read-write operations on IORefs, like Java have for volatile variables? _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
participants (2)
-
Alexey Egorov
-
David Kraeutmann