阅读背景:

并发编程之ConcurrentHashMap源码解析(一)_zhao6406879的博客

来源:互联网 

ConcurrentHashMap简介

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




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: