Why ReentrantLock exists when we have synchronized, tryLock with timeout, lockInterruptibly, fair vs unfair queuing, Condition as a superior wait/notify, ReadWriteLock's read/write separation, writer starvation, and StampedLock's optimistic read — the fastest read-mostly data structure primitive.
// Lessons
- 01soon
Why ReentrantLock When We Have synchronized?
- 02soon
ReentrantLock — tryLock, lockInterruptibly, Fair vs Unfair
- 03soon
ReentrantLock Must Be in try-finally — The Unlock Guarantee
- 04soon
Condition — The Superior wait/notify with Explicit Locks
- 05soon
ReadWriteLock — Read-Write Separation for Low-Write Workloads
- 06soon
ReadWriteLock: Writer Starvation and Mitigation
- 07soon
StampedLock — Optimistic Reads and the Validate Pattern
- 08soon
Deadlock with Explicit Locks — Detection and Prevention