摘要: 1、自定义线程池 一般情况下,定义一个线程池,可以用这样的方法: ExecutorService executorService = new ThreadPoolExecutor(2, 50, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<>(10)); 阅读全文
posted @ 2022-03-12 15:05 aaacarrot 阅读(637) 评论(0) 推荐(0) 编辑
摘要: Future, FutureTask, CompletionService, CompletableFuture 几者比较 先直接采用一下网上某位大佬的比对结果 所以,看了这么多,直接用 CompletableFuture 就可以了?至少得用 CompletionService ? 看着有点晕 Co 阅读全文
posted @ 2022-03-12 12:14 aaacarrot 阅读(153) 评论(0) 推荐(0) 编辑