摘要: 1.Future接口 1.1 什么是Future? 在jdk的官方的注解中写道 A {@code Future} represents the result of an asynchronous * computation. Methods are provided to check if the 阅读全文
posted @ 2019-12-13 17:46 小天儿 阅读(642) 评论(0) 推荐(0) 编辑
摘要: 一、ThreadPoolExecutor的重要参数 corePoolSize:核心线程数 核心线程会一直存活,及时没有任务需要执行 当线程数小于核心线程数时,即使有线程空闲,线程池也会优先创建新线程处理 设置allowCoreThreadTimeout=true(默认false)时,核心线程会超时关 阅读全文
posted @ 2019-12-13 16:18 小天儿 阅读(306) 评论(0) 推荐(0) 编辑