一.CountDownLatch 文档描述 A synchronization aid that allows one or more threads to wait until* a set of operations being performed in other threads completes. 是一个同步帮助工具,允许一个或多个线程等待一系列其他线程操作完后,再执行. count down 倒计时 latch 插锁 在Java中Latch结尾的也叫 闭锁 简单示例 public c…
介绍 JDK1.8引入CompletableFuture类. 使用方法 public class CompletableFutureTest { private static ExecutorService threadPool = new ThreadPoolExecutor(40, 100, 0L, TimeUnit.MILLISECONDS, new ArrayBlockingQueue<>(20)); public String B() { System.out.println(&qu…