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 newCachedThreadPool Example

In this tutorial, we will learn about Executor’s newCachedThreadPool factory method. In the last tutorial, I have shared introduction to ThreadPoolExecutor. If you are not aware of concepts of ThreadPoolExecutor, you should go through that first. …