
13 Jan
2012
13 Jan
'12
1:04 p.m.
Hi, My question is regarding the correct us of STM in Haskell. I have put to together a simple example, which represents more verbose code in a library that I am writing. 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. Here's my example: http://pastebin.com/Hit5vKmk . Is this example permissible? thanks, -- Rob Stewart