Note: this article is a "stub" and is due to be expanded soon!
ConcurerntSkipListMap
Java 6 adds a further weapon to the collections armoury in the form of the
ConcurrentSkipListMap. In terms of its general functionality, this class is a kind
of cross between a ConcurrentHashMap
and a TreeMap. In other words:
- like ConcurrentHashMap, it allows modifications without locking the entire map;
- like TreeMap, it maintains the keys permanently sorted, thus providing an
efficient means of retrieving a submap containing mappings of all
the keys within a particular range (in terms of the API, this means it implements
SortedMap).
However, compared to ConcurrentHashMap, ConcurrentSkipListMap has
some different performance characteristics:
- it provides more scalable concurrency even over ConcurrentHashMap;
- this concurrency is paid for with non-constant access times.
If you enjoy this Java programming article, please share with friends and colleagues. Follow the author on Twitter for the latest news and rants.
Editorial page content written by Neil Coffey. Copyright © Javamex UK 2021. All rights reserved.