一、ConcurrentHashMap ConcurrentHashMap是线程安全的HashMap ConcurrentHashMap在JDK1.8中是以CAS+synchronized实现的线程安全 CAS:在没有hash冲突时(Node要放在数组上时) synchronized:在出现hash冲突时(Node存放的位置已经有数据了) 存储的结构:数组+链表+红黑树 1.2.1 put方法 public V put(K key, V value) { return putVal(key, value, false); } 1.2.2 putVal方法-散列算法 final V putVal(K key, V value, boolean onlyIfAbsent) { if (key == null || value == null) throw new NullPointerException(); int hash = spread(key.hashCode()); int binCount = 0; } static final int spread(int h) {...