Hashmap concurrency issue

后端 未结 9 773
南旧
南旧 2020-11-30 01:54

I have a Hashmap that, for speed reasons, I would like to not require locking on. Will updating it and accessing it at the same time cause any issues, assuming I don\'t min

9条回答
  •  有刺的猬
    2020-11-30 02:21

    Like others mentionned use a ConcurrentHashMap or synchronize the map when updating it.

提交回复
热议问题