Previous | Next --- Slide 4 of 64
Back to Lecture Thumbnails

Transactional memory is an atomic and isolated sequence of memory operations. Its properties are

  • atomicity (when committing, all writes take effect together. when aborting, no writes take effect)

  • isolation (nobody else can observe the writes before the transaction commits)

  • serializability (transactions appear to commit in a serial order)


A transaction is an sequence of memory operations. A transaction should be atomic and isolated with other transactions.


Atomic is a high level declaration. It does not actually specify how to implement the atomicity (could use locks, or lock free). A lock is a low-level primitive, that can be used to implement atomicity, however it does not provide atomicity on its own


I think the main difference between locks and transactions is that locks only allow one thread to enter the critical section while transactions allow multiple threads to enter the critical section and abort some of them when there is a conflict.