Using thread-safe navigable maps

The ConcurrentNavigableMap is an interface that defines interesting data structures provided by the Java API that you can use in your concurrent programs. The classes that implement the ConcurrentNavigableMap interface stores elements in two parts:

  • A key that uniquely identifies an element
  • The rest of the data that defines the element, called value

The Java API also provides a class that implements ConcurrentSkipListMap, which is the interface that implements a non-blocking list with the behavior of the ConcurrentNavigableMap interface. Internally, it uses a Skip List to store data. A Skip List is a data structure based on parallel lists that allow us to get the kind of efficiency that is associated with ...

Get Java 9 Concurrency Cookbook - Second 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.