How to implement ConcurrentHashMap with features similar in LinkedHashMap?

后端 未结 6 775
离开以前
离开以前 2021-02-04 05:14

I have used LinkedHashMap with accessOrder true along with allowing a maximum of 500 entries at any time as the LRU cache for data. But due to scalabil

6条回答
  •  爱一瞬间的悲伤
    2021-02-04 05:57

    The moment you use another data structure along with concurrenthashmap, the atomicity of the operations sucha adding a new item in concurrenthashmap and adding in other data structure cant be guaranteed without additional synchronization such as ReadWriteLock which will degrade performance

提交回复
热议问题