Solving the Threshold ProblemAnother IMS Fast Path Technique
Use a blind Decrement (no threshold) and Verify(x, n), which returns true if x ? n
Re-execute Verify at commit time
- If it returns a different value than it did during normal execution, then abort
- It’s like checking that the threshold lock you didn’t set during Decrement is still valid.
bEnough = Verify(iQuantity, n);
If (bEnough) Decrement(iQuantity, n)
else print (“not enough”);