[Java - Synchronization] Latches
1) Countdown Latch
A synchronization aid that allows one or more threads to wait until a set of operations being performed in other threads completes.A CountDownLatch is initialized with a given count. The await method is blocked until the current count reaches zero; we can reduce current count using the method, countDown().
The count cannot be reset.
2) Cyclic Barrier
Similar to countdown latch, but the count can reset.
Comments
Post a Comment