java.util.concurrent |
Utility classes commonly useful in concurrent programming. |
Java Source File Name | Type | Comment |
AbstractExecutorService.java | Class | Provides default implementations of
ExecutorService execution methods. |
ArrayBlockingQueue.java | Class | A bounded
backed by an
array. |
BlockingDeque.java | Interface | A
Deque that additionally supports blocking operations that wait
for the deque to become non-empty when retrieving an element, and wait for
space to become available in the deque when storing an element.
BlockingDeque methods come in four forms, with different ways
of handling operations that cannot be satisfied immediately, but may be
satisfied at some point in the future:
one throws an exception, the second returns a special value (either
null or false, depending on the operation), the third
blocks the current thread indefinitely until the operation can succeed,
and the fourth blocks for only a given maximum time limit before giving
up. |
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.
BlockingQueue methods come in four forms, with different ways
of handling operations that cannot be satisfied immediately, but may be
satisfied at some point in the future:
one throws an exception, the second returns a special value (either
null or false, depending on the operation), the third
blocks the current thread indefinitely until the operation can succeed,
and the fourth blocks for only a given maximum time limit before giving
up. |
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.
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. |
ConcurrentMap.java | Interface | A
java.util.Map providing additional atomic
putIfAbsent, remove, and replace methods. |
ConcurrentNavigableMap.java | Interface | A
ConcurrentMap supporting
NavigableMap operations,
and recursively so for its navigable sub-maps. |
ConcurrentSkipListMap.java | Class | A scalable concurrent
ConcurrentNavigableMap implementation.
The map is sorted according to the
of its keys, or by a
Comparator provided at map
creation time, depending on which constructor is used.
This class implements a concurrent variant of SkipLists providing
expected average log(n) time cost for the
containsKey, get, put and
remove operations and their variants. |
ConcurrentSkipListSet.java | Class | A scalable concurrent
NavigableSet implementation based on
a
ConcurrentSkipListMap . |
CopyOnWriteArrayList.java | Class | A thread-safe variant of
java.util.ArrayList in which all mutative
operations (add, set, and so on) are implemented by
making a fresh copy of the underlying array.
This is ordinarily too costly, but may be more efficient
than alternatives when traversal operations vastly outnumber
mutations, and is useful when you cannot or don't want to
synchronize traversals, yet need to preclude interference among
concurrent threads. |
CopyOnWriteArraySet.java | Class | A
java.util.Set that uses an internal
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.
The
CountDownLatch.await await methods block until the current count reaches
zero due to invocations of the
CountDownLatch.countDown method, after which
all waiting threads are released and any subsequent invocations of
CountDownLatch.await await return immediately. |
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 | |
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.
An ExecutorService can be shut down, which will cause
it to reject new tasks. |
Future.java | Interface | A Future represents the result of an asynchronous
computation. |
FutureTask.java | Class | A cancellable asynchronous computation. |
LinkedBlockingDeque.java | Class | An optionally-bounded
based on
linked nodes.
The optional capacity bound constructor argument serves as a
way to prevent excessive expansion. |
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. |
package-info.java | | |
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 . |
RunnableFuture.java | Interface | A
Future that is
Runnable . |
RunnableScheduledFuture.java | Interface | A
ScheduledFuture that is
Runnable . |
ScheduledExecutorService.java | Interface | An
ExecutorService that can schedule commands to run after a given
delay, or to execute periodically.
The schedule methods create tasks with various delays
and return a task object that can be used to cancel or check
execution. |
ScheduledFuture.java | Interface | A delayed result-bearing action that can be cancelled. |
ScheduledThreadPoolExecutor.java | Class | |
Semaphore.java | Class | A counting semaphore. |
SynchronousQueue.java | Class | A
in which each insert
operation must wait for a corresponding remove operation by another
thread, and vice versa. |
ThreadFactory.java | Interface | An object that creates new threads on demand. |
ThreadPoolExecutor.java | Class | |
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. |