Tagged articles
LockSupport
11 articles · Page 1 of 1
This article explains five Java thread communication methods—volatile flag, Object wait/notify, CountDownLatch, ReentrantLock with Condition, and LockSupport—with runnable code examples showing how each coordinates a producer thread adding items and a consumer thread triggered at the fifth addition.
ConcurrencyCountDownLatchJava
0 likes · 10 min read

This article explains Java's AbstractQueuedSynchronizer (AQS) core model using a service counter analogy, detailing how the state variable and CLH queue manage thread synchronization, the template method pattern separating queuing logic from acquisition rules, and how LockSupport.park/unpark enable efficient thread blocking and waking, illustrated with ReentrantLock and CountDownLatch examples.
AQSAbstractQueuedSynchronizerCLH Queue
0 likes · 7 min read


DabaoshiAug 16, 2026 · Backend Development
This article dissects Java’s AbstractQueuedSynchronizer (AQS), explaining its three core components—volatile state, CAS, and a FIFO wait queue—how exclusive and shared modes operate, the step‑by‑step lock acquisition flow, ReentrantLock implementation details, fairness trade‑offs, and the underlying template‑method design pattern.
AQSConcurrencyJava
0 likes · 15 min read

This article explains the classic ABA issue in Java's Compare‑And‑Swap (CAS) operations, outlines why long spin loops and single‑variable limitations can degrade performance, and presents practical solutions such as AtomicStampedReference, LockSupport, ReentrantLock, and optimized data structures to mitigate these challenges.
ABA problemCASJava Concurrency
0 likes · 4 min read

This article demonstrates five Java thread‑communication approaches—using a volatile flag, Object.wait()/notify(), CountDownLatch, ReentrantLock with Condition, and LockSupport—each illustrated with complete code examples and explanations of their behavior and limitations.
ConcurrencyCountDownLatchJava
0 likes · 10 min read

This article explains five Java thread‑communication techniques—volatile variables, Object.wait()/notify(), CountDownLatch, ReentrantLock with Condition, and LockSupport—providing code examples and detailed explanations of how each method works and its synchronization behavior, including sample programs that add elements to a list, demonstrate notification timing, and show how locks are acquired and released.
ConcurrencyCountDownLatchJava
0 likes · 11 min read

This article compares five Java thread‑communication techniques—volatile flag, Object.wait()/notify(), CountDownLatch, ReentrantLock with Condition, and LockSupport—by presenting concrete code examples, explaining their underlying mechanisms, and discussing their advantages and drawbacks.
ConcurrencyCountDownLatchJava
0 likes · 13 min read


政采云技术Apr 28, 2022 · Fundamentals
This article explores thread blocking and waking mechanisms in Java using LockSupport and Unsafe, explaining how these low-level tools enable thread scheduling without traditional locks.
Java ConcurrencyLockSupportUnsafe class
0 likes · 15 min read


JavaEdgeJan 4, 2020 · Backend Development
This article explains how Java’s Unsafe class provides low‑level park and unpark methods, how the LockSupport utility wraps them for easier use, and demonstrates building a simple exclusive lock with AbstractQueuedSynchronizer, covering state handling, blocking mechanisms, and thread‑queue management.
AQSConcurrencyCustomLock
0 likes · 7 min read

This article explains the internal mechanisms of Java's AbstractQueuedSynchronizer, detailing how the CLH synchronization queue, the shouldParkAfterFailedAcquire method, and the LockSupport utility work together to decide when a thread should spin, block, or be unblocked, with full code examples and step‑by‑step analysis.
AQSCLHQueueConcurrency
0 likes · 8 min read

This article explains the structure, features, and internal workings of Java's ReentrantReadWriteLock, compares it with ReentrantLock and synchronized, provides usage examples, analyzes state management with bitwise operations, and covers lock acquisition, release, downgrade, and the role of LockSupport.
ConcurrencyJavaLockSupport
0 likes · 10 min read
