Tagged articles
9 articles
Page 1 of 1
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
Top Architect
Top Architect
Aug 17, 2023 · Backend Development

Thread Communication in Java: volatile, wait/notify, CountDownLatch, ReentrantLock+Condition, and LockSupport

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.

CountDownLatchJavaLockSupport
0 likes · 11 min read
Thread Communication in Java: volatile, wait/notify, CountDownLatch, ReentrantLock+Condition, and LockSupport
Architect
Architect
Aug 16, 2023 · Backend Development

5 Practical Ways to Implement Thread Communication in Java

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.

CountDownLatchJavaLockSupport
0 likes · 13 min read
5 Practical Ways to Implement Thread Communication in Java
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
Selected Java Interview Questions
Selected Java Interview Questions
Jul 30, 2020 · Backend Development

Java Thread Communication Techniques: join, wait/notify, CountDownLatch, CyclicBarrier, Callable and FutureTask

This article explains various Java thread‑communication mechanisms—including thread.join(), object.wait()/notify(), CountDownLatch, CyclicBarrier, Callable, and FutureTask—through clear examples, code snippets, and execution results, helping developers coordinate thread execution and retrieve results from worker threads.

Thread Communicationmultithreading
0 likes · 15 min read
Java Thread Communication Techniques: join, wait/notify, CountDownLatch, CyclicBarrier, Callable and FutureTask
Java Backend Technology
Java Backend Technology
Oct 10, 2017 · Fundamentals

Mastering Java Thread Communication: Wait/Notify Explained with Real Code

This article introduces Java's wait/notify thread communication mechanism, explains its principles with analogies, details the behavior of wait and notify methods, provides step‑by‑step code examples—including a simple producer‑consumer queue—and highlights important considerations such as lock handling and thread states.

JavaThread Communicationconcurrency
0 likes · 9 min read
Mastering Java Thread Communication: Wait/Notify Explained with Real Code