我正在阅读文章“Java theory and practice: Building a better HashMap”,该文章对 ConcurrentHashMap 的实现进行了出色的概述。
我还在 Stackoverflow 上找到了一些关于它的讨论 here .
尽管我在脑海中质疑使用 ConcurrentHashMap 的“场景/应用程序/位置是什么”。
谢谢
最佳答案
您将在与使用 HashMap
的相同实例中使用 ConcurrentHashMap
,只是您计划在多个线程上使用该映射。
关于java - ConcurrentHashMap 的例子,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4080177/