摘要: 线程池:三大方法、七大参数、4种拒绝策略 线程池的好处 1、降低资源的消耗 2、提高响应速度 3、方便管理 线程复用、可以控制最大并发数、管理线程 三大方法 ExecutorService threadPool = Executors.newSingleThreadExecutor(); //创建只 阅读全文
posted @ 2021-01-06 21:58 刘指导 阅读(80) 评论(0) 推荐(0) 编辑
摘要: 什么时候扩容 jdk 1.7 判断是否达到了阈值(0.75 × 数组长度) 同时这次put是否产生了Hash冲突 if ((size >= threshold) && (null != table[bucketIndex])) { resize(2 * table.length); //两倍扩容 h 阅读全文
posted @ 2021-01-06 16:56 刘指导 阅读(749) 评论(0) 推荐(0) 编辑