23.10 Concurrent Collections
In Chapter 16, we introduced various collections from the Java Collections API. We also mentioned that you can obtain synchronized versions of those collections to allow only one thread at a time to access a collection that might be shared among several threads. The collections from the java.util.concurrent
package are specifically designed and optimized for sharing collections among multiple threads.
Figure 23.22 lists the many concurrent collections in package java.util.concurrent
. The entries for ConcurrentHashMap
and LinkedBlockingQueue
are shown in bold because these are by far the most frequently used concurrent ...
Get Java How To Program, Late Objects, 11th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.