其他分享
首页 > 其他分享> > ThreadLocal笔记

ThreadLocal笔记

作者:互联网

 1 static class ThreadLocalMap {
 2 ...
 3  * The table, resized as necessary.
 4          * table.length MUST always be a power of two.
 5          */
 6         private Entry[] table;
 7 
 8         /**
 9          * The number of entries in the table.
10          */
11         private int size = 0;
12 
13         /**
14          * The next size value at which to resize.
15          */
16         private int threshold; // Default to 0
17 
18         /**
19          * Set the resize threshold to maintain at worst a 2/3 load factor.
20          */
21         private void setThreshold(int len) {
22             threshold = len * 2 / 3;
23         }
24 ...
25 }

这个  private int threshold;  属性意思是ThreadLocalMap内的Entry[]数组最大数据项 项数的意思。

由于 《Java数据结构和算法中文版 -- 第二版》 第11 章 哈希表 : 

 

标签:数据项,int,private,ThreadLocal,笔记,哈希,threshold,table
来源: https://www.cnblogs.com/cici-new/p/15701815.html