Java review: Set frame (one picture)

Source: Internet
Author: User

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.