Expand description
Stratum 12 — Transactional Memory
Optimistic concurrency with composable transactions, built from Strata 0–11.
Software transactional memory — optimistic transactions over TRef cells.
A Stm<A, E> describes a transactional program. commit (alias
atomically) runs it to completion: on Outcome::Retry or a
failed commit validation the attempt restarts after std::thread::yield_now.
Concurrency: all commits are serialized behind a global lock; transaction bodies record read versions and defer writes until commit succeeds.
Structs§
- Stm
- Transactional program composable with
Stm::flat_map,Stm::map, etc. - TMap
- Transactional map in a
TRef(hash map snapshot per transaction). - TQueue
- Transactional queue backed by a
TRef. - TRef
- Transactional mutable cell (shared with
Arcidentity). - TSemaphore
- Transactional permit counter in a
TRef. - Txn
- One attempt of a transactional read/write set.
Enums§
Functions§
- atomically
- Alias for
commit(Effect.ts naming). - commit
- Run
stmuntil it commits successfully (syncEffect::newbody; safe forcrate::runtime::run_blocking).