Java基礎(十二)----concurrentHashMap與線程池

1、 concurentHashMap 一、 hashmap、hashtable、concurrentHashMap hashmap: 非線程安全的 hashtable: 線程安全的,經過鎖定整個map來保證線程安全,效率低下 concurrentHashMap: 線程安全的,一個concurrentHashMap中有多個鎖,每次操做時,只能保證單次操做的原子性,如: 單次put或單次get,若是
相關文章
相關標籤/搜索