Locking Higher-Level Operations
Read is often part of a read-write pair, such as Increment(x, n), which adds constant n to x, but doesn’t return a value.
Increment (and Decrement) commute
So, introduce Increment and Decrement locks
- But if Inc and Dec have a threshold (e.g. a quantity of zero), then they conflict (when the threshold is near)