When should I use ConcurrentSkipListMap?

前端 未结 6 1461
孤独总比滥情好
孤独总比滥情好 2020-12-12 13:31

In Java, ConcurrentHashMap is there for better multithreading solution. Then when should I use ConcurrentSkipListMap? Is it a redundan

6条回答
  •  囚心锁ツ
    2020-12-12 13:53

    Sorted, navigable, and concurrent

    See Skip List for a definition of the data structure.

    A ConcurrentSkipListMap stores the Map in the natural order of its keys (or some other key order you define). So it'll have slower get/put/contains operations than a HashMap, but to offset this it supports the SortedMap, NavigableMap, and ConcurrentNavigableMap interfaces.

提交回复
热议问题