Crate stim[src]
STM for Rust
libstim
is an (incomplete) implementation of software transactional
memory based roughly on the design used in the Haskell STM library.
For examples, look at the tests at the end of the source.
Caveats
This library requires a hacked-up version of libstd that allows a task to recover from unwinding. This is used to abort and restart transactions and recover from transient errors due to the program having an inconsistent view of variables. It also makes the interface a lot easier to use since client applications don't need to manually propagate transaction failures.
https://github.com/bkoropoff/rust/tree/unwind-hacks
References
Paper on Haskell implementation
http://research.microsoft.com/en-us/um/people/simonpj/papers/stm/stm.pdf
Structs
Borrow | Immutable variable borrow |
MutBorrow | Mutable variable borrow |
Transaction | Transaction context |
Var | A transaction variable. |
Functions
atomically | Perform transaction |