Java.util.concurrent Synchronizers: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 4: Line 4:


=CountDownLatch=
=CountDownLatch=
==External==


* https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CountDownLatch.html
* https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CountDownLatch.html
==Overview==
A <tt>CountDownLatch</tt> is a synchronization tool that allows one or more threads to wait on it until a certain number of operations being performed in other threads completes. The latch is initialized with a count. Any thread calling <tt>await()</tt> blocks unit the count reaches zero, after which it is released. The count is decremented with <tt>countDown()</tt>.


=Semaphore=
=Semaphore=

Revision as of 01:15, 25 January 2016

Internal

CountDownLatch

External

Overview

A CountDownLatch is a synchronization tool that allows one or more threads to wait on it until a certain number of operations being performed in other threads completes. The latch is initialized with a count. Any thread calling await() blocks unit the count reaches zero, after which it is released. The count is decremented with countDown().



Semaphore