zoukankan      html  css  js  c++  java
  • What's the difference between ConcurrentHashMap and Collections.synchronizedMap(Map)?

    来自:http://stackoverflow.com/questions/510632/whats-the-difference-between-concurrenthashmap-and-collections-synchronizedmap
       http://javarevisited.blogspot.hk/2011/04/difference-between-concurrenthashmap.html

    ╔═══════════════╦═══════════════════╦═══════════════════╦═════════════════════╗ ║ Property ║ HashMap ║ Hashtable ║ ConcurrentHashMap ║ ╠═══════════════╬═══════════════════╬═══════════════════╩═════════════════════╣ ║ Null ║ allowed ║ not allowed ║ ║ values/keys ║ ║ ║ ╠═══════════════╬═══════════════════╬═════════════════════════════════════════╣ ║Is thread-safe ║ no ║ yes ║ ╠═══════════════╬═══════════════════╬═══════════════════╦═════════════════════╣ ║ Lock ║ not ║ locks the whole ║ locks the portion ║ ║ mechanism ║ applicable ║ map ║ ║ ╠═══════════════╬═══════════════════╩═══════════════════╬═════════════════════╣ ║ Iterator ║ fail-fast ║ fail-safe ║ ╚═══════════════╩═══════════════════════════════════════╩═════════════════════╝
  • 相关阅读:
    设计模式之单例模式
    设计模式之原型模式
    设计模式之建造者模式
    设计模式之抽象方法模式
    设计模式之简单工厂模式
    java中内存分配
    java引用类型
    Oracle
    Oracle
    Oracle
  • 原文地址:https://www.cnblogs.com/sunxucool/p/5477274.html
Copyright © 2011-2022 走看看