Showing posts from October, 2020

Concurrent Collection in Java

Concurrent Collection In Synchronized Collection a thread lock the entire list. Only one thread access the entire list at a time. In concurrent collection a threat lock one element, each  element can be accessed by different thread concurrently  Java supported multithreading and concurrency from initiation. Java has introduced the concurrent collection in java 5.0 and java 6.0 over the synchronized collection to improve the performance in a multithreading environment. java has provided concurrent collection API apart from collection API to handle the multithreading and concurrency in a better manner. We can find all the new concurrent collection Interfaces and Classes under the package name java.util.concurrent. In this article, we will focus on some Key interfaces and classes of the java.util.concurrent package. Synchronized Collection V/S Concurrent Collection: Synchronized Collection: Synchronized Collections are slow in performance  Multiple threads can access a synchronized coll