ConcurrentHashMap简介
ConcurrentHashMap是java中并发安全的HashMap,HashMap是我们最常使用的容器,但HashMap是不安全的。在多线程情况下,需使用ConcurrentHashMap。ConcurrentHashMap在jdk1.7底层使用Segment实现分段锁,ConcurrentHashMap底层是Segment数组,而每个Segment对象下面是个小型的HashMap。Segment对象继承ReentrantLock,操作时通过ReentrantLock来实现锁操作。ConcurrentHashMap是