ConcurrentHashMap1.8源码学习之扩容(链表结构)
读源码时,transfer(Node<K,V>[] tab, Node<K,V>[] nextTab)方法总是看不懂,咋整呢?画图吧,梳理下执行过程。初始容量16,标号为0的槽位下各节点Hash值如下图,
intn= tab.length
intrunBit= fh& n;
Node<K,V> lastRun = f;
如图,n=16,二进制位10000,如果fh是10000,那么runBit=10000&10000(16&1...
原创
2020-10-06 21:55:32 ·
756 阅读 ·
0 评论