Tagged articles

Lock Implementation

2 articles · Page 1 of 1
Java Tech Workshop
Java Tech Workshop
Sep 6, 2026 · Fundamentals

How Does AQS Queue Threads? CLH Queue, State & Condition Variables Deep Dive

This article provides a comprehensive source-code-level analysis of Java's AbstractQueuedSynchronizer (AQS), detailing its three core components—state, CLH wait queue, and ConditionObject—and walking through exclusive lock acquisition/release, fair vs non-fair locking, shared lock propagation, and condition variable await/signal mechanics with code examples.

AQSCLH queueCondition Variable
0 likes · 37 min read
How Does AQS Queue Threads? CLH Queue, State & Condition Variables Deep Dive
Sohu Tech Products
Sohu Tech Products
Feb 19, 2025 · Fundamentals

Deep Dive into ReentrantLock: Fair Lock vs Non-Fair Lock Implementation Principles

The article explains Java’s ReentrantLock implementation, contrasting fair locks that queue threads in request order with non‑fair locks that allow immediate acquisition, detailing the internal Sync, FairSync and NonfairSync classes, lock/unlock mechanisms, performance trade‑offs, and guidance on selecting the appropriate lock type.

AQSJUCJava concurrency
0 likes · 19 min read
Deep Dive into ReentrantLock: Fair Lock vs Non-Fair Lock Implementation Principles