Thread Archive

Java Exchanger example

Exchanger class is introduced with java 1.5 with other classes such ConcurrentHashMap, CountDownLatch, Semaphores. Exchanger class is used to exchange object between two threads. Exchanger simply waits until two separate threads calls exchange method, when …

Java Semaphore example

In this tutorial, we are going to see about Semaphore in java. Semaphore is a class in java.util.concurrent package introduced in JDK 5. Semaphore basically maintains a set of permits, so there are two methods …

CountDownLatch in java

As per java docs, CountDownLatch is synchronisation aid that allow one or more threads to wait until set of operations being performed in other threads completes. So in other words, CountDownLatch waits for other threads to complete set of operations. …

Join Our News Letter - Stay Updated

Subscribe to Awesome Java Content.
You can like our facebook page Java2blog