Java Concurrent API

Category: Java   Tags: Java, Java Thread, Java MultiThread, Thread Synchronization, Immutable Objects, Java Concurrent API

Java 5 added a new Java package to the Java platform, the java.util.concurrent package. It contains a set of classes that makes it easier to develop concurrent applications in Java.

java.util.concurrent has two subpackage: java.util.concurrent.atomic and java.util.concurrent.locks

java.util.concurrent

This package provide alternate ways of doing synchronization and interthread communication. It provides below features:

Synchronizers: The synchronizer classes defined by java.util.concurrent are:

Executors

Concurrent collections

The Fork/Join Framework

java.util.concurrent.atomic

This package provide classes that can be used to update the value in a concurrent environment. For example AtomicInteger.

java.util.concurrent.locks

It has interfaces and classes providing a framework for locking. Interfaces are: Condition, Lock and ReadWriteLock.