Programming Languages
Java
Subjective
Sep 24, 2025
What is the difference between CountDownLatch and CyclicBarrier?
Detailed Explanation
CountDownLatch: One-time use, threads wait for countdown to reach zero, cannot be reset. Use case: waiting for multiple tasks to complete. CyclicBarrier: Reusable, threads wait for each other at barrier point, can be reset. Use case: parallel processing where threads need to synchronize at checkpoints.
Discussion (0)
No comments yet. Be the first to share your thoughts!
Share Your Thoughts