Tagged articles
22 articles
Page 1 of 1
Sohu Tech Products
Sohu Tech Products
May 7, 2025 · Backend Development

Master Java Concurrency: Fork/Join, CountDownLatch, CyclicBarrier, Semaphore & Exchanger Deep Dive

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.

CountDownLatchCyclicBarrierExchanger
0 likes · 25 min read
Master Java Concurrency: Fork/Join, CountDownLatch, CyclicBarrier, Semaphore & Exchanger Deep Dive
Full-Stack Internet Architecture
Full-Stack Internet Architecture
May 6, 2025 · Backend Development

Understanding Java CyclicBarrier with Practical Examples

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.

CyclicBarrierJavaSynchronization
0 likes · 6 min read
Understanding Java CyclicBarrier with Practical Examples
Xuanwu Backend Tech Stack
Xuanwu Backend Tech Stack
Jan 10, 2025 · Backend Development

Mastering CountDownLatch and CyclicBarrier: Java Concurrency Made Simple

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.

CountDownLatchCyclicBarrierJava
0 likes · 10 min read
Mastering CountDownLatch and CyclicBarrier: Java Concurrency Made Simple
IT Services Circle
IT Services Circle
Jun 27, 2023 · Fundamentals

Using CyclicBarrier for Alternating Thread Printing of ABC in Java

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.

CyclicBarrierJavaconcurrency
0 likes · 5 min read
Using CyclicBarrier for Alternating Thread Printing of ABC in Java
Mike Chen's Internet Architecture
Mike Chen's Internet Architecture
Apr 20, 2023 · Backend Development

Overview of Four Core Java Concurrency Utilities

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
Overview of Four Core Java Concurrency Utilities
IT Services Circle
IT Services Circle
Apr 3, 2022 · Backend Development

Four Ways to Determine When a Java ThreadPool Has Completed All Tasks

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.

CountDownLatchCyclicBarrierJava
0 likes · 12 min read
Four Ways to Determine When a Java ThreadPool Has Completed All Tasks
FunTester
FunTester
Dec 25, 2021 · Backend Development

Java Thread Synchronization Utilities: CountDownLatch, CyclicBarrier, and Phaser

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.

CountDownLatchCyclicBarrierJava
0 likes · 7 min read
Java Thread Synchronization Utilities: CountDownLatch, CyclicBarrier, and Phaser
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Nov 1, 2021 · Backend Development

Understanding Java Concurrency Utilities: CyclicBarrier, CountDownLatch, Semaphore, and Exchanger

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.

CountDownLatchCyclicBarrierExchanger
0 likes · 11 min read
Understanding Java Concurrency Utilities: CyclicBarrier, CountDownLatch, Semaphore, and Exchanger
Programmer DD
Programmer DD
Sep 29, 2021 · Backend Development

When and How to Use CountDownLatch and CyclicBarrier in Java

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.

CountDownLatchCyclicBarrierJava
0 likes · 4 min read
When and How to Use CountDownLatch and CyclicBarrier in Java
Top Architect
Top Architect
Aug 10, 2021 · Backend Development

Understanding Java Concurrency Utilities: CountDownLatch, CyclicBarrier, Semaphore, and Exchanger

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.

CountDownLatchCyclicBarrierExchanger
0 likes · 13 min read
Understanding Java Concurrency Utilities: CountDownLatch, CyclicBarrier, Semaphore, and Exchanger
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Jul 10, 2021 · Backend Development

Concurrent Unit Testing of AssetService.update with Optimization Techniques

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.

AtomicIntegerCyclicBarrierJava
0 likes · 9 min read
Concurrent Unit Testing of AssetService.update with Optimization Techniques
Top Architect
Top Architect
May 24, 2021 · Backend Development

Understanding CountDownLatch, CyclicBarrier, Semaphore, and Exchanger in Java

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.

CountDownLatchCyclicBarrierExchanger
0 likes · 12 min read
Understanding CountDownLatch, CyclicBarrier, Semaphore, and Exchanger in Java
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Apr 12, 2021 · Backend Development

Understanding Java CyclicBarrier: Usage, Implementation Details, and Comparison with CountDownLatch

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.

Backend DevelopmentCountDownLatchCyclicBarrier
0 likes · 8 min read
Understanding Java CyclicBarrier: Usage, Implementation Details, and Comparison with CountDownLatch
FunTester
FunTester
Mar 11, 2021 · Operations

Accelerating Multi‑User Performance Tests with Java’s CyclicBarrier

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.

BackendCyclicBarrierJava
0 likes · 8 min read
Accelerating Multi‑User Performance Tests with Java’s CyclicBarrier
FunTester
FunTester
Dec 31, 2020 · Operations

Speed Up Load Test Preparation with Java CyclicBarrier

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.

CyclicBarrierJavaLoad Testing
0 likes · 8 min read
Speed Up Load Test Preparation with Java CyclicBarrier
FunTester
FunTester
Aug 3, 2020 · Backend Development

Mastering Java’s CyclicBarrier: Synchronize Threads with Ease

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.

CyclicBarrierJDK1.5Java
0 likes · 7 min read
Mastering Java’s CyclicBarrier: Synchronize Threads with Ease
Programmer DD
Programmer DD
Jul 1, 2018 · Backend Development

Mastering Java’s CyclicBarrier: How Threads Synchronize and What Can Go Wrong

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.

CyclicBarrierJavaconcurrency
0 likes · 10 min read
Mastering Java’s CyclicBarrier: How Threads Synchronize and What Can Go Wrong