
14 Jan
2012
14 Jan
'12
9:55 a.m.
"Bryan O'Sullivan"
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.
I'm not sure I understand the question, nor the answer? I thought the idea was that state should be consistent on the entry and exit of each "atomically" block. So you can break your program into multiple transactions, but each transaction should be a semantically complete unit. -k -- If I haven't seen further, it is by standing in the footprints of giants