Transactional Memory
Transactional memory is based on the idea of a transaction from database theory. Transactional memory makes working with threads a lot easier for two reasons: first data races and deadlocks disappear and second transactions are composable.
A transaction is an action that has the following properties Atomicity, Consistency, Isolation, and Durability (ACID). Except for the durability or storing the result of an action, all properties hold for transactional memory in C++. Now three short questions are left.
ACI(D)
What do atomicity, consistency, and isolation mean for an atomic block consisting of some statements?
- Atomicity
- Either all or none of the statements in the block are performed.
- Consistency
- The system is always in a consistent state. All transactions establish a total order.
- Isolation
- Each transaction runs in total isolation from other transactions.
How do...