Interruptible Lock Acquisition in Java
A thread blocked on lock acquisition is still consuming scheduling attention even if useful business progress is zero.
A thread blocked on lock acquisition is still consuming scheduling attention even if useful business progress is zero.
Some code paths should not wait indefinitely for a lock.
Fairness sounds like an obvious good, but in locking it comes with real cost.
ReentrantLock is the most widely used explicit lock in Java.
Java already had synchronized, so the Lock interface was not added to replace locking in general.