Q51: What are the differences between CountDownLatch and CyclicBarrier?
CountDownLatch: One or more threads wait until a set of operations in other threads complete (count decrements to zero viacountDown()). One-time use; count cannot be reset.CyclicBarrier: A set of threads wait for each other to reach a common barrier point (await()). Reusable; resets automatically after threads are released.
Key Takeaways
CountDownLatch= One-time count decrementer.CyclicBarrier= Reusable thread synchronization barrier.
Knowledge Check
Which synchronization utility can be reset and reused repeatedly across processing cycles?