Search code examples
javaalgorithmcollectionsconcurrencyconcurrenthashmap

What are the benefits of ConcurrentSkipListMap?


Possible Duplicate:
When should I use ConcurrentSkipListMap?

I mean if there is ConcurrentSkipListMap in java libs it might be sometimes better than ConcurrentHashMap. I wonder where ConcurrentSkipListMap really good?


Solution

  • ConcurrentSkipListMap supported SortedMap and NavigableMap. If you need data sorted, this is the one to use (Or TreeMap if you don't need concurrency)

    You can also wrap it with Collections.setFromMap() to create a concurrent SortedSet.