Java ConcurrentHashMap With Examples

ConcurrentHashMap in Java is a thread safe Map implementation which provides another alternative to be used in a multithreaded environment apart from HashTable or explicitly synchronizing HashMap. ConcurrentHashMap is part of the java.util.concurrent package. Table of contents How is ConcurrentHashMap a better option Internal implementation of ConcurrentHashMap in Java Java…

Continue reading

Java CopyOnWriteArrayList With Examples

CopyOnWriteArrayList in Java implements the List interface just like its other well known counterpart ArrayList and is part of java.util.concurrent package. How CopyOnWriteArrayList differs from ArrayList is that it is a thread-safe variant of ArrayList. For more differences between CopyOnWriteArrayList and ArrayList in Java refer this post- Difference Between ArrayList…

Continue reading

Java Executor Tutorial – Executor, ExecutorService, ScheduledExecutorService

In this Java executor tutorial you’ll learn how to use Executor, ExecutorService, ScheduledExecutorService and their thread pool implementations to effectively manage threads in a large scale application. Table of contents Java Executor API Java Executor interface Java ExecutorService interface Java ScheduledExecutorService interface Java Executor implementation classes Creating executors using Executors…

Continue reading