• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

concurrent CountDownLatch

 
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whether Java.util.concurrent.CountDownLatch is the replacement of synchronized block ?
 
author
Posts: 23959
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

kri shan wrote: Whether Java.util.concurrent.CountDownLatch is the replacement of synchronized block ?



No. The CountDownLatch class is not a replacement for the synchronize block. It is simply an implementation of a tool, that makes it easier to implement a common use case -- ie. the ability to release a group of threads when the threads in the group reach an agreed upon point.

If you are looking for a replacement for the synchronized block, then the ReentrantLock class is probably the best implementation for that.

Henry  
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic