[Haskell] Re: [Haskell-cafe] SimonPJ and Tim Harris explain STM
- video
Simon Peyton-Jones
simonpj at microsoft.com
Mon Nov 27 03:38:36 EST 2006
| Normally after a retry the STM block is rolled back and put to sleep and will
| only be awakened and re-executed if one of the STM variables it had read from is
| committed to by a different STM block.
The *semantics* are that it is retried anytime in the future. The *pragmatics* are as you describe.
| What about retryWith ? Will the STM block be put to sleep under the same
| conditions? Can the IO action given to retryWith include commits to STM variables?
The semantics are the same as before: the action passed to retryWith is run, and the block is retried anytime in the future. The pragmatics are the same: the action passed to retryWith is run, and the block is put to sleep only to be awakened if one of the STM variables it has read from has been written to -- which could have happened already if the IO action did so.
Simon
More information about the Haskell-Cafe
mailing list