1.

What Is Cyclicbarrier And Countdownlatch?

Answer»

CyclicBarrier and CountDownLatch in Java is a synchronizer introduced in JDK 5 on java.util.Concurrent package.Both CyclicBarrier and CountDownLatch are USED to IMPLEMENT a scenario where one THREAD waits for one or more Thread to complete there job before starts PROCESSING but there is one Difference between CountDownLatch and CyclicBarrier in Java which separates them apart and that is, you can not reuse same CountDownLatch instance oncecount reaches to zero and latch is open, on the other hand CyclicBarrier can be reused by resetting Barrier, Once barrier is broken.

CyclicBarrier and CountDownLatch in Java is a synchronizer introduced in JDK 5 on java.util.Concurrent package.Both CyclicBarrier and CountDownLatch are used to implement a scenario where one Thread waits for one or more Thread to complete there job before starts processing but there is one Difference between CountDownLatch and CyclicBarrier in Java which separates them apart and that is, you can not reuse same CountDownLatch instance oncecount reaches to zero and latch is open, on the other hand CyclicBarrier can be reused by resetting Barrier, Once barrier is broken.



Discussion

No Comment Found