This package includes a number of powerful utilities for multithreaded programming. Most of these utilities fall into three main categories:
This package extends the Java Collections Framework, adding the threadsafe classes
ConcurrentLinkedQueue. These classes achieve threadsafety without relying exclusively on
synchronizedmethods, greatly increasing the number of threads that can safely use them concurrently.
ConcurrentMapinterface, which adds important atomic methods to the base
In addition to these
this package also defines the
interface. Blocking queues are important in many concurrent
algorithms, and this package provides a variety of useful
- Asynchronous Execution with Thread Pools
java.util.concurrentprovides a robust framework for asynchronous execution of tasks defined by the existing
java.lang.Runnableinterface or the new
ScheduledExecutorServiceinterfaces define methods for executing (or scheduling for future execution)
Futureinterface represents the future result of the asynchronous execution of a task.
Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.