[Haskell-cafe] Efficient mutable arrays in STM
Alberto G. Corona
agocorona at gmail.com
Thu Oct 27 20:58:05 CEST 2011
> The main question is: does the STM transaction actually "see" that I
> part of the underlying array, so that the transaction gets re-tried? Or do
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe