[Haskell-cafe] STM atomic blocks in IO functions

Bryan O'Sullivan bos at serpentine.com
Fri Jan 13 19:25:27 CET 2012


On Fri, Jan 13, 2012 at 10:04 AM, Rob Stewart
<robstewart57 at googlemail.com>wrote:

>
> The question is a simple one. Must all operations on a TVar happen
> within *the same* atomically block, or am I am I guaranteed thread
> safety if, say, I have a number of atomically blocks in an IO
> function.
>

If you want successive operations to see a consistent state, they must
occur in the same atomically block.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120113/4d20eeb6/attachment.htm>


More information about the Haskell-Cafe mailing list