其他分享
首页 > 其他分享> > JDK1.7中关于多线程操作HashMap的成环以及丢失问题

JDK1.7中关于多线程操作HashMap的成环以及丢失问题

作者:互联网

JDK1.7中关于多线程操作HashMap的成环以及丢失问题

文章目录

1. 预备知识

扩容产生的条件:

HashMap的插入

	public HashMap(int initialCapacity, float loadFactor) {
	    if (initialCapacity < 0)
	        throw new IllegalArgumentException("Illegal initial capacity: " +
	                                           initialCapacity);
	    if (initialCapacity > MAXIMUM_CAPACITY)
	        initialCapacity = MAXIMUM_CAPACITY;
	    if (loadFactor <= 0 || Float.isNaN(loadFactor))
	        throw new IllegalArgumentException("Illegal load factor: " +
	                                           loadFactor);
	
	    this.loadFactor = loadFactor;
	    threshold = initialCapacity;// 

标签:hash,HashMap,JDK1.7,len,next,线程,newTable,Entry,多线程
来源: https://blog.csdn.net/qq_42898299/article/details/122700404