Tag

FairLock

1 views collected around this technical thread.

Zhuanzhuan Tech
Zhuanzhuan Tech
Dec 2, 2024 · Fundamentals

Understanding Fair and Unfair Locks in Java's ReentrantLock

This article explains the concepts, creation methods, usage examples, and internal implementation details of fair and unfair locks in Java's ReentrantLock, comparing their performance characteristics and providing guidance on when to choose each type in multithreaded applications.

ConcurrencyFairLockJava
0 likes · 23 min read
Understanding Fair and Unfair Locks in Java's ReentrantLock
Top Architect
Top Architect
Jul 17, 2022 · Backend Development

Understanding CAS, ABA Problem, and AQS in Java Concurrency: Fair vs Non‑Fair Locks

This article explains the fundamentals of CAS (compare‑and‑swap), the ABA problem and its version‑stamp solution, introduces AbstractQueuedSynchronizer (AQS) as the core of Java concurrency utilities, and compares fair and non‑fair lock implementations in ReentrantLock with code examples and diagrams.

ABAAQSCAS
0 likes · 9 min read
Understanding CAS, ABA Problem, and AQS in Java Concurrency: Fair vs Non‑Fair Locks
Top Architect
Top Architect
Jul 9, 2021 · Backend Development

Understanding ReentrantLock: Fair and Non-Fair Lock Mechanisms in Java

This article explains the internal workings of Java's ReentrantLock, comparing fair and non‑fair lock acquisition, detailing the role of AQS, CLH queues, CAS operations, thread parking, and unlock procedures with full source‑code excerpts.

ConcurrencyFairLockJava
0 likes · 10 min read
Understanding ReentrantLock: Fair and Non-Fair Lock Mechanisms in Java
Java Captain
Java Captain
May 3, 2020 · Fundamentals

Understanding Java AQS, ReentrantLock, Fair vs Non‑Fair Locks, and Condition Implementation

This article provides a comprehensive walkthrough of Java's AbstractQueuedSynchronizer (AQS), its state and FIFO wait queue, the inner workings of ReentrantLock with both non‑fair and fair lock strategies, and the detailed mechanics of Condition objects with code examples and diagrams.

AQSConcurrencyCondition
0 likes · 21 min read
Understanding Java AQS, ReentrantLock, Fair vs Non‑Fair Locks, and Condition Implementation