java.util.concurrent |
|
Java Source File Name | Type | Comment |
AbstractExecutorService.java | Class | Provides default implementation of
ExecutorService execution methods. |
ArrayBlockingQueue.java | Class | A bounded
backed by an
array. |
BlockingQueue.java | Interface | A
java.util.Queue that additionally supports operations
that wait for the queue to become non-empty when retrieving an element,
and wait for space to become available in the queue when storing an
element.
A BlockingQueue does not accept null elements.
Implementations throw NullPointerException on attempts
to add, put or offer a null. |
BrokenBarrierException.java | Class | Exception thrown when a thread tries to wait upon a barrier that is
in a broken state, or which enters the broken state while the thread
is waiting. |
Callable.java | Interface | A task that returns a result and may throw an exception.
Implementors define a single method with no arguments called
call.
The Callable interface is similar to
java.lang.Runnable , in that both are designed for classes whose
instances are potentially executed by another thread. |
CancellationException.java | Class | Exception indicating that the result of a value-producing task,
such as a
FutureTask , cannot be retrieved because the task
was cancelled. |
CompletionService.java | Interface | A service that decouples the production of new asynchronous tasks
from the consumption of the results of completed tasks. |
ConcurrentHashMap.java | Class | A hash table supporting full concurrency of retrievals and
adjustable expected concurrency for updates. |
ConcurrentLinkedQueue.java | Class | An unbounded thread-safe
based on linked nodes. |
ConcurrentMap.java | Interface | A
java.util.Map providing additional atomic
putIfAbsent, remove, and replace methods. |
CopyOnWriteArrayList.java | Class | |
CopyOnWriteArraySet.java | Class | A
java.util.Set that uses
java.util.concurrent.CopyOnWriteArrayList for all of its
operations. |
CountDownLatch.java | Class | A synchronization aid that allows one or more threads to wait until
a set of operations being performed in other threads completes.
A CountDownLatch is initialized with a given
count. |
CyclicBarrier.java | Class | A synchronization aid that allows a set of threads to all wait for
each other to reach a common barrier point. |
Delayed.java | Interface | A mix-in style interface for marking objects that should be
acted upon after a given delay. |
DelayQueue.java | Class | An unbounded
of Delayed
elements, in which an element can only be taken when its delay has expired. |
Exchanger.java | Class | A synchronization point at which two threads can exchange objects.
Each thread presents some object on entry to the
Exchanger.exchangeexchange method, and receives the object presented by the other
thread on return.
Sample Usage:
Here are the highlights of a class that uses an Exchanger to
swap buffers between threads so that the thread filling the
buffer gets a freshly
emptied one when it needs it, handing off the filled one to
the thread emptying the buffer.
class FillAndEmpty {
Exchanger<DataBuffer> exchanger = new Exchanger();
DataBuffer initialEmptyBuffer = ... |
ExecutionException.java | Class | Exception thrown when attempting to retrieve the result of a task
that aborted by throwing an exception. |
Executor.java | Interface | An object that executes submitted
Runnable tasks. |
ExecutorCompletionService.java | Class | A
CompletionService that uses a supplied
Executor to execute tasks. |
Executors.java | Class | Factory and utility methods for
Executor ,
ExecutorService ,
ScheduledExecutorService ,
ThreadFactory , and
Callable classes defined in this
package. |
ExecutorService.java | Interface | An
Executor that provides methods to manage termination and
methods that can produce a
Future for tracking progress of
one or more asynchronous tasks. |
Future.java | Interface | A Future represents the result of an asynchronous
computation. |
FutureTask.java | Class | A cancellable asynchronous computation. |
LinkedBlockingQueue.java | Class | An optionally-bounded
based on
linked nodes.
This queue orders elements FIFO (first-in-first-out).
The head of the queue is that element that has been on the
queue the longest time.
The tail of the queue is that element that has been on the
queue the shortest time. |
PriorityBlockingQueue.java | Class | An unbounded
that uses
the same ordering rules as class
PriorityQueue and supplies
blocking retrieval operations. |
RejectedExecutionException.java | Class | Exception thrown by an
Executor when a task cannot be
accepted for execution. |
RejectedExecutionHandler.java | Interface | A handler for tasks that cannot be executed by a
ThreadPoolExecutor . |
ScheduledExecutorService.java | Interface | An
ExecutorService that can schedule commands to run after a given
delay, or to execute periodically. |
ScheduledFuture.java | Interface | A delayed result-bearing action that can be cancelled. |
ScheduledThreadPoolExecutor.java | Class | A
ThreadPoolExecutor that can additionally schedule
commands to run after a given delay, or to execute
periodically. |
Semaphore.java | Class | A counting semaphore. |
SynchronousQueue.java | Class | A
in which each
put must wait for a take, and vice versa. |
ThreadFactory.java | Interface | An object that creates new threads on demand. |
ThreadPoolExecutor.java | Class | An
ExecutorService that executes each submitted task using
one of possibly several pooled threads, normally configured
using
Executors factory methods.
Thread pools address two different problems: they usually
provide improved performance when executing large numbers of
asynchronous tasks, due to reduced per-task invocation overhead,
and they provide a means of bounding and managing the resources,
including threads, consumed when executing a collection of tasks.
Each ThreadPoolExecutor also maintains some basic
statistics, such as the number of completed tasks.
To be useful across a wide range of contexts, this class
provides many adjustable parameters and extensibility
hooks. |
TimeoutException.java | Class | Exception thrown when a blocking operation times out. |
TimeUnit.java | enum | A TimeUnit represents time durations at a given unit of
granularity and provides utility methods to convert across units,
and to perform timing and delay operations in these units. |