Java基础(十二)----concurrentHashMap与线程池

1、 concurentHashMap 一、 hashmap、hashtable、concurrentHashMap hashmap: 非线程安全的 hashtable: 线程安全的,经过锁定整个map来保证线程安全,效率低下 concurrentHashMap: 线程安全的,一个concurrentHashMap中有多个锁,每次操做时,只能保证单次操做的原子性,如: 单次put或单次get,若是
相关文章
相关标签/搜索