61 |
|
java.util.concurrent.PriorityBlockingQueue}, and {@link |
62 |
|
java.util.concurrent.DelayQueue}. The different classes cover the most |
63 |
|
common usage contexts for producer-consumer, messaging, parallel |
64 |
< |
tasking, and related concurrent designs. |
64 |
> |
tasking, and related concurrent designs. The {@link |
65 |
> |
java.util.concurrent.BlockingDeque} interface extends |
66 |
> |
<tt>BlockingQueue</tt> to support both FIFO and LIFO (stack-based) |
67 |
> |
operations. Class {@link java.util.concurrent.LinkedBlockingDeque} |
68 |
> |
provides an implementation. |
69 |
|
|
70 |
|
|
71 |
|
<h2>Timing</h2> |
95 |
|
|
96 |
|
<h2>Concurrent Collections</h2> |
97 |
|
|
98 |
< |
Besides Queues, this package supplies a few Collection implementations |
99 |
< |
designed for use in multithreaded contexts: {@link |
100 |
< |
java.util.concurrent.ConcurrentHashMap}, {@link |
101 |
< |
java.util.concurrent.CopyOnWriteArrayList}, and {@link |
102 |
< |
java.util.concurrent.CopyOnWriteArraySet}. |
98 |
> |
Besides Queues, this package supplies Collection implementations |
99 |
> |
designed for use in multithreaded contexts: |
100 |
> |
{@link java.util.concurrent.ConcurrentHashMap}, |
101 |
> |
{@link java.util.concurrent.ConcurrentSkipListMap}, |
102 |
> |
{@link java.util.concurrent.ConcurrentSkipListSet}, |
103 |
> |
{@link java.util.concurrent.CopyOnWriteArrayList}, and |
104 |
> |
{@link java.util.concurrent.CopyOnWriteArraySet}. |
105 |
> |
When many threads are expected to access a given collection, |
106 |
> |
a <tt>ConcurrentHashMap</tt> is normally preferable to |
107 |
> |
a synchronized <tt>HashMap</tt>, and a |
108 |
> |
<tt>ConcurrentSkipListMap</tt> is normally preferable |
109 |
> |
to a synchronized <tt>TreeMap</tt>. A |
110 |
> |
<tt>CopyOnWriteArrayList</tt> is preferable to |
111 |
> |
a synchronized <tt>ArrayList</tt> when the expected number of reads |
112 |
> |
and traversals greatly outnumber the number of updates to a list. |
113 |
|
|
114 |
|
<p>The "Concurrent" prefix used with some classes in this package is a |
115 |
|
shorthand indicating several differences from similar "synchronized" |