Java Reference
In-Depth Information
25.9. Utility Subpackages
Some of the utility classes in java.util are not independent classes but
groups of related classes that together provide a particular function-
ality. These classes are themselves grouped into subpackages within
java.util . [1]
[1] For pragmatic reasons the collections classes had to be defined at the top level of java.util , rather
than in a subpackage, because of the existing legacy collections.
25.9.1. Concurrency Utilities java.util.concurrent
The package java.util.concurrent , together with its subpackages provides
a range of utilities for writing efficient multithreaded applications. These
utilities expand the in-built synchronization facilities of the Java program-
ming language to allow building concurrent applications that would not
otherwise be possible with synchronized code, and to simplify common
synchronization tasks that would otherwise be tedious and error-prone to
write using the language facilities. The utilities provided can be divided
into five categories:
Concurrent collections These were described in Chapter 21 .
Synchronizers A group of utility classes that simplify common syn-
chronization tasks (discussed below).
Executor framework A framework for asynchronous task execu-
tion, including a flexible, high-performance thread pool imple-
mentation.
Locks and Conditions Classes that provide locking and waiting cap-
abilities that go beyond those of the built-in monitor capabilities.
Atomic variables A set of classes that allow safe expression of lock-
free and wait-free algorithms within an application.
There are four synchronizer classes:
 
 
Search WWH ::




Custom Search