脚本宝典收集整理的这篇文章主要介绍了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 章 哈希表 :
以上是脚本宝典为你收集整理的ThreadLocal笔记全部内容,希望文章能够帮你解决ThreadLocal笔记所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。