90 * providing a common extensible implementation of Futures, and |
90 * providing a common extensible implementation of Futures, and |
91 * {@link java.util.concurrent.ExecutorCompletionService}, that |
91 * {@link java.util.concurrent.ExecutorCompletionService}, that |
92 * assists in coordinating the processing of groups of |
92 * assists in coordinating the processing of groups of |
93 * asynchronous tasks. |
93 * asynchronous tasks. |
94 * |
94 * |
|
95 * <p>Class {@link java.util.concurrent.ForkJoinPool} provides an |
|
96 * Executor primarily designed for processing instances of {@link |
|
97 * java.util.concurrent.ForkJoinTask} and its subclasses. These |
|
98 * classes employ a work-stealing scheduler that attains high |
|
99 * throughput for tasks conforming to restrictions that often hold in |
|
100 * computation-intensive parallel processing. |
|
101 * |
95 * <h2>Queues</h2> |
102 * <h2>Queues</h2> |
96 * |
103 * |
97 * The {@link java.util.concurrent.ConcurrentLinkedQueue} class |
104 * The {@link java.util.concurrent.ConcurrentLinkedQueue} class |
98 * supplies an efficient scalable thread-safe non-blocking FIFO |
105 * supplies an efficient scalable thread-safe non-blocking FIFO |
99 * queue. |
106 * queue. |
107 * {@link java.util.concurrent.PriorityBlockingQueue}, and |
114 * {@link java.util.concurrent.PriorityBlockingQueue}, and |
108 * {@link java.util.concurrent.DelayQueue}. |
115 * {@link java.util.concurrent.DelayQueue}. |
109 * The different classes cover the most common usage contexts |
116 * The different classes cover the most common usage contexts |
110 * for producer-consumer, messaging, parallel tasking, and |
117 * for producer-consumer, messaging, parallel tasking, and |
111 * related concurrent designs. |
118 * related concurrent designs. |
|
119 * |
|
120 * <p> Extended interface {@link java.util.concurrent.TransferQueue}, |
|
121 * and implementation {@link java.util.concurrent.LinkedTransferQueue} |
|
122 * introduce a synchronous {@code transfer} method (along with related |
|
123 * features) in which a producer may optionally block awaiting its |
|
124 * consumer. |
112 * |
125 * |
113 * <p>The {@link java.util.concurrent.BlockingDeque} interface |
126 * <p>The {@link java.util.concurrent.BlockingDeque} interface |
114 * extends {@code BlockingQueue} to support both FIFO and LIFO |
127 * extends {@code BlockingQueue} to support both FIFO and LIFO |
115 * (stack-based) operations. |
128 * (stack-based) operations. |
116 * Class {@link java.util.concurrent.LinkedBlockingDeque} |
129 * Class {@link java.util.concurrent.LinkedBlockingDeque} |
134 * not to wait at all. To wait "forever", you can use a value |
147 * not to wait at all. To wait "forever", you can use a value |
135 * of {@code Long.MAX_VALUE}. |
148 * of {@code Long.MAX_VALUE}. |
136 * |
149 * |
137 * <h2>Synchronizers</h2> |
150 * <h2>Synchronizers</h2> |
138 * |
151 * |
139 * Four classes aid common special-purpose synchronization idioms. |
152 * Five classes aid common special-purpose synchronization idioms. |
140 * {@link java.util.concurrent.Semaphore} is a classic concurrency tool. |
153 * <ul> |
141 * {@link java.util.concurrent.CountDownLatch} is a very simple yet very |
154 * |
142 * common utility for blocking until a given number of signals, events, |
155 * <li>{@link java.util.concurrent.Semaphore} is a classic concurrency tool. |
143 * or conditions hold. A {@link java.util.concurrent.CyclicBarrier} is a |
156 * |
144 * resettable multiway synchronization point useful in some styles of |
157 * <li>{@link java.util.concurrent.CountDownLatch} is a very simple yet |
145 * parallel programming. An {@link java.util.concurrent.Exchanger} allows |
158 * very common utility for blocking until a given number of signals, |
146 * two threads to exchange objects at a rendezvous point, and is useful |
159 * events, or conditions hold. |
147 * in several pipeline designs. |
160 * |
|
161 * <li>A {@link java.util.concurrent.CyclicBarrier} is a resettable |
|
162 * multiway synchronization point useful in some styles of parallel |
|
163 * programming. |
|
164 * |
|
165 * <li>A {@link java.util.concurrent.Phaser} provides |
|
166 * a more flexible form of barrier that may be used to control phased |
|
167 * computation among multiple threads. |
|
168 * |
|
169 * <li>An {@link java.util.concurrent.Exchanger} allows two threads to |
|
170 * exchange objects at a rendezvous point, and is useful in several |
|
171 * pipeline designs. |
|
172 * |
|
173 * </ul> |
148 * |
174 * |
149 * <h2>Concurrent Collections</h2> |
175 * <h2>Concurrent Collections</h2> |
150 * |
176 * |
151 * Besides Queues, this package supplies Collection implementations |
177 * Besides Queues, this package supplies Collection implementations |
152 * designed for use in multithreaded contexts: |
178 * designed for use in multithreaded contexts: |
257 * <li>For each pair of threads that successfully exchange objects via |
283 * <li>For each pair of threads that successfully exchange objects via |
258 * an {@code Exchanger}, actions prior to the {@code exchange()} |
284 * an {@code Exchanger}, actions prior to the {@code exchange()} |
259 * in each thread <i>happen-before</i> those subsequent to the |
285 * in each thread <i>happen-before</i> those subsequent to the |
260 * corresponding {@code exchange()} in another thread. |
286 * corresponding {@code exchange()} in another thread. |
261 * |
287 * |
262 * <li>Actions prior to calling {@code CyclicBarrier.await} |
288 * <li>Actions prior to calling {@code CyclicBarrier.await} and |
|
289 * {@code Phaser.awaitAdvance} (as well as its variants) |
263 * <i>happen-before</i> actions performed by the barrier action, and |
290 * <i>happen-before</i> actions performed by the barrier action, and |
264 * actions performed by the barrier action <i>happen-before</i> actions |
291 * actions performed by the barrier action <i>happen-before</i> actions |
265 * subsequent to a successful return from the corresponding {@code await} |
292 * subsequent to a successful return from the corresponding {@code await} |
266 * in other threads. |
293 * in other threads. |
267 * |
294 * |