Tagged articles
CyclicBarrier
26 articles · Page 1 of 1
This article explains Java's CyclicBarrier synchronization utility, highlighting its reusability and callback support compared to CountDownLatch, and demonstrates its use in two examples: a basic three-thread barrier with a callback and a parallel array sum calculation where threads compute partial sums and aggregate at the barrier.
ConcurrencyCountDownLatchCyclicBarrier
0 likes · 6 min read

This article explains Java's CyclicBarrier through two practical examples: coordinating concurrent API stress tests and batch-importing one million Excel rows, then reveals a design flaw where the main thread participates in the barrier and shows how to separate concerns using CountDownLatch for cleaner batch processing.
API Stress TestingCountDownLatchCyclicBarrier
0 likes · 10 min read

This article explains the key differences between Java's CyclicBarrier and CountDownLatch, focusing on which threads wait, thread lifecycle after signaling, reusability, and a practical pressure-test example using CountDownLatch to simulate concurrent requests.
ConcurrencyCountDownLatchCyclicBarrier
0 likes · 8 min read


DabaoshiAug 19, 2026 · Backend Development
This article explains how Java's synchronization utilities—CountDownLatch, CyclicBarrier, Semaphore, Phaser, and Exchanger—solve coordination problems such as one‑time startup waits, repeated barrier synchronization, resource‑quota limiting, dynamic multi‑stage collaboration, and two‑thread data exchange, with concrete code examples and a full seckill‑system case study.
CountDownLatchCyclicBarrierExchanger
0 likes · 18 min read

This article provides a comprehensive guide to Java's core concurrency utilities—including Fork/Join, CountDownLatch, CyclicBarrier, Semaphore, and Exchanger—explaining their principles, internal AQS implementation, practical usage patterns, performance optimizations, and complete code examples for real‑world scenarios.
ConcurrencyCountDownLatchCyclicBarrier
0 likes · 25 min read

This article explains Java's CyclicBarrier synchronization tool, compares it with CountDownLatch, demonstrates basic and array‑sum examples with reusable barriers and callback actions, and shows how it can coordinate multiple threads for tasks such as parallel computation and result aggregation.
ConcurrencyCyclicBarrierJava
0 likes · 6 min read

CountDownLatch and CyclicBarrier are two essential Java synchronization tools from java.util.concurrent, enabling threads to coordinate tasks; this guide explains their concepts, usage with code examples, advantages, disadvantages, and key differences, helping developers choose the right tool for thread coordination.
ConcurrencyCountDownLatchCyclicBarrier
0 likes · 10 min read

This article explains how to use Java's CyclicBarrier to coordinate three threads that alternately print the characters A, B, and C, providing a detailed analysis, example analogy, complete implementation code, execution result, and a brief summary of its relevance in multithreading interviews.
ConcurrencyCyclicBarrierJava
0 likes · 5 min read

This article introduces the four essential Java concurrency utilities—CountDownLatch, CyclicBarrier, Semaphore, and Exchanger—explaining their functions, underlying principles, typical usage patterns, and practical scenarios such as thread synchronization, resource limiting, and data exchange in multithreaded applications.
CountDownLatchCyclicBarrierExchanger
0 likes · 7 min read

This article explains how to turn Java asynchronous invocations into synchronous ones by demonstrating five approaches—wait/notify, condition locks, Future, CountDownLatch, and CyclicBarrier—each illustrated with complete code examples and detailed execution flow.
CountDownLatchCyclicBarrierFuture
0 likes · 11 min read

This article explains four practical techniques—using isTerminated, comparing task counts, CountDownLatch, and CyclicBarrier—to reliably detect when a Java ThreadPoolExecutor has finished executing all submitted tasks, including code examples, advantages, disadvantages, and a summary of each method.
ConcurrencyCountDownLatchCyclicBarrier
0 likes · 12 min read

An overview of Java’s three primary thread‑synchronization tools—CountDownLatch, CyclicBarrier, and Phaser—explaining their placement in java.util.concurrent, typical use‑cases such as coordinating multi‑threaded tasks in performance testing, and the advantages of each, complemented by illustrative diagrams.
ConcurrencyCountDownLatchCyclicBarrier
0 likes · 7 min read

This article provides a comprehensive overview of Java's core concurrency utilities—CyclicBarrier, CountDownLatch, Semaphore, and Exchanger—explaining their purposes, internal mechanisms, constructors, usage patterns, and code examples to help developers master multithreaded programming.
ConcurrencyCountDownLatchCyclicBarrier
0 likes · 11 min read


政采云技术Oct 22, 2021 · Fundamentals
This article explains three Java concurrency tools - CountDownLatch, CyclicBarrier, and Semaphore - detailing their mechanisms, source code analysis, and practical usage scenarios with code examples.
AQSCountDownLatchCyclicBarrier
0 likes · 13 min read

This article explains the purpose, usage, and real‑world scenarios of Java’s CountDownLatch and CyclicBarrier synchronization aids, illustrating their behavior with relatable analogies and providing guidance on when to apply each construct in multithreaded applications.
ConcurrencyCountDownLatchCyclicBarrier
0 likes · 4 min read

This article explains four Java concurrency utilities—CountDownLatch, CyclicBarrier, Semaphore, and Exchanger—detailing their concepts, typical use cases, and providing complete code examples that demonstrate synchronization patterns such as thread coordination, resource limiting, and data exchange.
ConcurrencyCountDownLatchCyclicBarrier
0 likes · 13 min read

This article explains how to write a concurrent unit test for the AssetService.update method using thread pools, CountDownLatch, AtomicInteger, and then suggests optimizations such as replacing AtomicInteger with LongAdder and employing CyclicBarrier to increase contention, providing full code examples and detailed explanations.
ConcurrencyCyclicBarrierJava
0 likes · 9 min read

This article explains Java’s concurrency utilities CountDownLatch, CyclicBarrier, Semaphore, and Exchanger, illustrating their concepts with race‑style analogies, providing complete code examples, and showing execution results to demonstrate how threads can synchronize, wait, limit, and exchange data.
ConcurrencyCountDownLatchCyclicBarrier
0 likes · 12 min read

This article explains the concept, practical usage, internal implementation, and key methods of Java's CyclicBarrier, compares it with CountDownLatch, and provides a complete code example demonstrating how multiple threads can repeatedly synchronize at a reusable barrier.
ConcurrencyCountDownLatchCyclicBarrier
0 likes · 8 min read

This article explains how Java's CountDownLatch, CyclicBarrier, and Phaser classes work, compares their features, and shows practical scenarios—especially in performance testing—where each synchronization tool can be applied effectively.
ConcurrencyCountDownLatchCyclicBarrier
0 likes · 4 min read

This article explains how to eliminate the serial‑login bottleneck in multi‑user performance testing by using Java’s CyclicBarrier to synchronize user logins, then runs a two‑step insert‑update scenario with a custom FunTester class, complete with full code examples and result analysis.
BackendConcurrencyCyclicBarrier
0 likes · 8 min read

This article explains how to use Java's CyclicBarrier and related concurrency utilities to parallelize user login preparation for load testing, reducing setup time and synchronizing multi‑stage performance tests with concrete code examples and sample console output.
ConcurrencyCyclicBarrierJava
0 likes · 8 min read

This article explains Java’s CyclicBarrier synchronization barrier introduced in JDK 1.5, detailing its constructors, key methods such as await() and reset(), usage patterns for coordinating multiple threads in performance testing, and provides a complete demo with code examples and practical tips for handling timeouts and exceptions.
ConcurrencyCyclicBarrierJDK1.5
0 likes · 7 min read

This article explains Java’s CyclicBarrier synchronization aid, detailing its purpose, constructors, the await() workflow, internal implementation with ReentrantLock and Condition, generation handling, error scenarios, timeout support, and provides a complete multithreaded example illustrating its practical use.
ConcurrencyCyclicBarrierJava
0 likes · 10 min read

This article explains how to achieve thread communication and coordination in Java using Thread.join(), Object.wait()/notify(), CountDownLatch, CyclicBarrier, and the Callable/FutureTask pair, providing complete code examples and execution results for each technique.
CountDownLatchCyclicBarrierFutureTask
0 likes · 14 min read

This article explains how CountDownLatch and CyclicBarrier work in Java, illustrates their usage with practical Dragon‑Ball analogies, compares their features, and provides code snippets and real‑time system scenarios to help developers synchronize threads effectively.
ConcurrencyCountDownLatchCyclicBarrier
0 likes · 8 min read
