CompletableFuture reuse thread from pool
问题 I'm testing Completable Future. As described here I thought thread would be reused from common pool but this snippet shows strange behaviour for (int i = 0; i < 10000; i++) { final int counter = i; CompletableFuture.supplyAsync(() -> { System.out.println("Looking up " + counter + " on thread " + Thread.currentThread().getName()); return null; }); } I have that kind of output: Looking up 0 on thread Thread-2 Looking up 1 on thread Thread-3 Looking up 2 on thread Thread-4 ... Looking up 10000