note-OS
4-5 Atomic Transaction
Why not keep using lock?
- reduce concurrency
- lead to deadlock
- lead to priority inversion. low priority blocks high priority thread, caused high priority thread starved. example: Mars Pathfinder
- lead to convoying. a performance problem caused by the overhead of repeated context switches from each time a thread attempts to acquire the lock and fails.
- lack of soft&hard composability: it is hard to combine small, correct lock-based modules into equally correct larger programs without modifying the modules or at least knowing about their internals.
Transaction: groups of operations executed by a thread.
- Serializability:
- idea: go without