The last one is missing. Add:
Concurrenthashmap:is thread-safe(based onLockimplemented, the lock is not the whole object when synchronizing, but adds thesynchronizedis to lock the whole object .), the realization ofMapinterface, he was inHashMapon the basis of the data are divided into a number of smallSegment (segmented lock, he inherited theReentrantlock), the default -, each time the operation issegmentlock, avoid the chance of multithreading, improve concurrency efficiency, from his source can be seen, he introduced a "segmented lock" concept, is can be regarded as aMapinto a lot ofHashTable (HashTableevery time you lock a whole table,), according toKey.hashcode ()to decide toKeyput it in whichhashTablein whichGetis calculated based on theKey.hashcode (),from whichhashTablein the Take out
load factor:0.75, if the position of 75% in the table is already filled with elements, it will expand twice times ( For example: the default initial capacity is When the used space is (75%) , it is automatically expanded to 2*16=32)
The loading factor is the ratio of the occupied space and all the space in the hash table .
initial capacity defaults to 16
The larger the loading factor, the higher the space utilization, but the more the conflict opportunity, the more the cost of querying data, the less the space utilization, the lower the conflict opportunity.
If there is a wrong place, also please everyone feel free, hehe
Java review: Set frame (one picture)