«« Next » « Previous
«« Next » « Previous

Link Details

Wouldn't it be cool if everybody did it? Login and vote now.
Link 65280 thumbnail

By adobni
via java.dzone.com
Published: Feb 07 2008 / 11:49

Java 5 introduced many new concurrency primitives and collections, and this post is going to look at two classes that can be used to coordinate threads: CountDownLatch and CyclicBarrier. A CountDownLatch is initialized with a counter. Threads can then either count down on the latch or wait for it to reach 0. When the latch reaches 0, all waiting threads are released.
  • 21
  • 0
  • 1234
  • 340

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.