Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

What is difference between CyclicBarriar and CountdownLatch in Java ?

user-image
Question ajoutée par Mohd shahnawaz khan , Associate Project , Cognizant Technology Solution
Date de publication: 2013/11/15
Muhammed Rahshad Koyippalli
par Muhammed Rahshad Koyippalli , Cisco DNAC Senior Escalation Engineer , Cisco Systems - India

The main difference between CyclicBarrier and CountDownLatch is that CyclicBarrier is reusable and CountDownLatch is not. You can reuse CyclicBarrier by calling reset() method which resets the barrier to its initial state.

CountDownLatch is good for one time event like application/module start-up time and CyclicBarrier can be used to in case of recurrent event e.g. concurrently (re-)calculating each time when the input data changed.

More Questions Like This

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?