Tagged articles
17 articles
Page 1 of 1
Architect's Guide
Architect's Guide
Jun 27, 2025 · Backend Development

Demystifying Java Locks: From Pessimistic vs Optimistic to ReentrantLock Internals

This article explains the classification of Java locks—including pessimistic, optimistic, fair, and unfair variants—details their state transitions from biased to heavyweight, and walks through the source code of ReentrantLock and Condition to illustrate how synchronization, queuing, and thread parking are implemented in the JVM.

AQSConditionLocks
0 likes · 20 min read
Demystifying Java Locks: From Pessimistic vs Optimistic to ReentrantLock Internals
Sohu Tech Products
Sohu Tech Products
Apr 29, 2025 · Backend Development

Mastering Java Concurrency: Deep Dive into Threads, Locks, and AQS

This comprehensive guide explores Java multithreading fundamentals, covering thread creation, lifecycle, synchronization challenges, context switching costs, deadlock detection, various lock mechanisms such as synchronized, ReentrantLock, ReadWriteLock, and the underlying AbstractQueuedSynchronizer architecture with practical code examples and performance tips.

AQSConditionJava
0 likes · 42 min read
Mastering Java Concurrency: Deep Dive into Threads, Locks, and AQS
Xuanwu Backend Tech Stack
Xuanwu Backend Tech Stack
Jan 9, 2025 · Fundamentals

Master Java Thread Communication: wait/notify, Locks, Conditions & BlockingQueue

This article explores Java's thread communication techniques—including the basic wait/notify mechanism, advanced Lock and Condition usage, and the thread‑safe BlockingQueue—providing detailed explanations, producer‑consumer examples, and additional concurrency utilities like CountDownLatch, illustrating how to coordinate threads efficiently in multithreaded applications.

BlockingQueueConditionCountDownLatch
0 likes · 18 min read
Master Java Thread Communication: wait/notify, Locks, Conditions & BlockingQueue
Su San Talks Tech
Su San Talks Tech
Oct 23, 2024 · Backend Development

Unlocking Java’s AQS: A Deep Dive into AbstractQueuedSynchronizer and Concurrency Primitives

This article explores the origins of Java's JUC package, explains the core concepts of AbstractQueuedSynchronizer—including template methods, exclusive and shared acquisition, CLH queues, CAS, and LockSupport—and demonstrates how locks, conditions, and synchronization mechanisms are implemented and used in real-world Java concurrency.

AQSConditionJava
0 likes · 30 min read
Unlocking Java’s AQS: A Deep Dive into AbstractQueuedSynchronizer and Concurrency Primitives
Su San Talks Tech
Su San Talks Tech
Dec 30, 2022 · Fundamentals

Unlocking Java Concurrency: A Deep Dive into AQS, Locks, and Condition Queues

This article explains Java's AbstractQueuedSynchronizer (AQS) framework, covering its MESA monitor model, entry and condition wait queues, exclusive and shared lock acquisition and release, and how core concurrency utilities like ReentrantLock, ReadWriteLock, CountDownLatch, Semaphore, ThreadPoolExecutor, and CyclicBarrier are built upon it.

AQSConditionJava
0 likes · 30 min read
Unlocking Java Concurrency: A Deep Dive into AQS, Locks, and Condition Queues
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Nov 30, 2022 · Backend Development

Understanding Java J.U.C Locks: ReentrantLock, ReentrantReadWriteLock, and Condition

This article introduces Java's java.util.concurrent (J.U.C) package, explains its lock mechanisms—including Lock, ReentrantLock, ReentrantReadWriteLock, and Condition—provides detailed code examples, and discusses lock types such as fair, non‑fair, and read/write locks for effective multithreaded synchronization.

ConditionJUCJava
0 likes · 16 min read
Understanding Java J.U.C Locks: ReentrantLock, ReentrantReadWriteLock, and Condition
Full-Stack Internet Architecture
Full-Stack Internet Architecture
May 28, 2021 · Backend Development

Deep Dive into Java's AbstractQueuedSynchronizer (AQS) and Concurrency Utilities

This article provides a comprehensive explanation of Java's JUC origins, the design and implementation of AbstractQueuedSynchronizer (AQS), its template methods for exclusive and shared locks, the CLH queue mechanism, lock implementations, condition queues, and related code examples, illustrating how high‑performance concurrency primitives such as ReentrantLock, CountDownLatch, Semaphore, and ReentrantReadWriteLock work under the hood.

AQSConditionJava
0 likes · 26 min read
Deep Dive into Java's AbstractQueuedSynchronizer (AQS) and Concurrency Utilities
JavaEdge
JavaEdge
Apr 28, 2021 · Backend Development

How to Build a Blocking Queue with Two Condition Variables in Java

The article explains the role of Java's Condition interface as a monitor's condition variable, contrasts it with synchronized's wait/notify, and walks through using two Condition objects to implement a blocking queue that handles empty and full states, illustrating key await/signal patterns.

BlockingQueueConditionJava
0 likes · 3 min read
How to Build a Blocking Queue with Two Condition Variables in Java
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Jan 13, 2021 · Backend Development

Understanding Java's AbstractQueuedSynchronizer (AQS) and Concurrency Utilities

This article provides an in-depth explanation of Java's AbstractQueuedSynchronizer (AQS) framework, covering its role in JUC concurrency utilities such as locks, semaphores, CountDownLatch, ReentrantReadWriteLock, and Condition, including template methods, state management, node structures, queue algorithms, and practical code examples.

AQSConditionJUC
0 likes · 25 min read
Understanding Java's AbstractQueuedSynchronizer (AQS) and Concurrency Utilities
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Dec 16, 2020 · Backend Development

Using Condition to Replace wait/notify for Safer and Faster Java Thread Communication

This article explains why Java's Condition class should replace wait/notify for thread communication, demonstrates the thread‑livelock problem with notify, shows how Condition avoids it, compares performance with notifyAll, and provides complete code examples for producer‑consumer scenarios.

ConditionJavaThread Communication
0 likes · 13 min read
Using Condition to Replace wait/notify for Safer and Faster Java Thread Communication
Programmer DD
Programmer DD
Dec 28, 2018 · Cloud Native

Simplify Message Routing with @StreamListener Conditions in Spring Cloud Stream

Using Spring Cloud Stream’s @StreamListener condition attribute, this guide shows how to route messages by header values, providing a full example that includes a producer sending version‑tagged messages, a consumer with two conditional listeners, required configuration, and sample log output demonstrating the simplified processing flow.

@StreamListenerConditionJava
0 likes · 5 min read
Simplify Message Routing with @StreamListener Conditions in Spring Cloud Stream
BiCaiJia Technology Team
BiCaiJia Technology Team
Sep 9, 2017 · Backend Development

Mastering Java Concurrency: ReentrantLock, Condition, and ReadWriteLock Explained

This article demonstrates how to use Java's ReentrantLock, Condition, and ReentrantReadWriteLock classes to implement synchronization, waiting/notification, producer‑consumer patterns, and read‑write locking, providing code examples, execution results, and tips for avoiding deadlocks and improving thread coordination.

ConditionReadWriteLockReentrantLock
0 likes · 17 min read
Mastering Java Concurrency: ReentrantLock, Condition, and ReadWriteLock Explained