O'Reilly logo

Hands-On High Performance with Spring 5 by Dinesh Radadiya, Prashant Goswami, Pritesh Shah, Subhash Shah, Chintan Mehta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Concurrent collection classes

The concurrent collection classes provide more scalability and performance than other collection classes, such as HashMap or Hashtable. The following are useful concurrent classes provided in the java.util.concurrent package:

  • ConcurrentHashMap: This is similar to HashMap and Hashtable, but it has been designed to work in concurrent programming without the need for explicit synchronization. Hashtable and ConcurrentHashMap are both thread-safe collections, but ConcurrentHashMap is more advanced than Hashtable. It does not lock the entire collection for synchronization, so it is very useful when there are a lot of updates and fewer concurrent reads.
  • BlockingQueue: The producer-consumer pattern is the most common ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required