
27 Oct
2011
27 Oct
'11
2:58 p.m.
The main question is: does the STM transaction actually "see" that I changed part of the underlying array, so that the transaction gets re-tried? Or do I have to implement this manually, and if yes: how?
The transaction does not detect anything inside the unsafeIOtoSTM. But to implement this manually is simple: use "retry" whenever you need to retry the local transaction. if the affected transactions are more than the local trnasaction, create an special TVar to be inspected by all of them. for example doesTheArrayHasChanged :: TVar Bool.