Java Concurrency - java.util.concurrent

Java Conceptuel Diagram

About

Since Java 1.5, java.util.concurrent

Executors

(Interfaces|Model)

Executor

See Executor

Future (Results and Execution cancelation)

A Future:

  • returns the results of a function, allows determination of whether execution has completed,
  • and provides a means to cancel execution.

A RunnableFuture is a Future that possesses a run method that upon (during ?) execution, sets its results.

Implementations

ThreadPool

Object

Factory

The Executor Service are normally created and configured using Executors factory methods. The Executors class provides:

  • factory methods for the most common kinds and configurations of Executors,
  • as well as a few utility methods for using them.

Futures

  • FutureTask: base implementation of future, with methods to start and cancel a computation, query to see if the computation is complete, and retrieve the result of the computation. A FutureTask can be used to wrap a Callable or Runnable object.

Completion Service

  • ExecutorCompletionService uses a supplied executor to execute tasks. This class arranges that submitted tasks are, upon completion, placed on a queue accessible using take. It assists in coordinating the processing of groups of asynchronous tasks.

ForkJoinTask

  • ForkJoinPool: Class ForkJoinPool provides an Executor primarily designed for processing instances of ForkJoinTask and its subclasses. These classes employ a work-stealing scheduler that attains high throughput for tasks conforming to restrictions that often hold in computation-intensive parallel processing.

Documentation / Reference





Discover More
Java Conceptuel Diagram
Java

Why has become so popular among application developers? Primarily because makes application developers more productive. It is a modern, robust, object-oriented language. ’s unprecedented popularity...
Java Conceptuel Diagram
Java - Concurrency (Parallel Work)

In concurrent or parallel programming, there are two basic units of execution: processes. A process is implemented as a main thread that can create other thread. and threads. Threads exist within...
Java Conceptuel Diagram
Java Concurrency - (Concurrent) Collections

All of the concurrent collections help avoid Memory Consistency Errors by defining a happens-before relationship between: an operation that adds an object to the collection with subsequent operations...
Java Conceptuel Diagram
Java Concurrency - (Queue|Stack)

and in Java concurrency context Interface and Implementation The java/util/concurrent/BlockingQueueBlockingQueue interface defines a first-in-first-out data structure that blocks or times out...
Java Conceptuel Diagram
Java Concurrency - Atomic Variable Access

in java The reads and writes operations are atomic for reference variables for most primitive variables (all types except long and double). all variables declared volatile (including long...
Java Conceptuel Diagram
Java Concurrency - Executor (Thread manager)

An executor is a thread management module (thread creation and management). java.util.concurrent provides two executor interfaces: java/util/concurrent/ExecutorExecutor is a simple standardized...
Java Conceptuel Diagram
Java Concurrency - Lock Objects (java.util.concurrent.locks)

java/util/concurrent/locks/package-summaryLock Object package is a High Level Concurrency of the java.util.concurrent. For low-level, intrinsic lock (monitor), see . There is interfaces and classes that...
Java Conceptuel Diagram
Java Concurrency - Timing (time-out based operations)

: The java/util/concurrent/TimeUnitTimeUnit class provides multiple granularities (including nanoseconds) for specifying and controlling time-out based operations. Most classes in the package contain...



Share this page:
Follow us:
Task Runner