MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / main

Method main

concurrent/CachedThreadPool2.java:9–16  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

7
8public class CachedThreadPool2 {
9 public static void main(String[] args) {
10 ExecutorService exec =
11 Executors.newCachedThreadPool();
12 IntStream.range(0, 10)
13 .mapToObj(InterferingTask::new)
14 .forEach(exec::execute);
15 exec.shutdown();
16 }
17}
18/* Output:
193 pool-1-thread-4 100

Callers

nothing calls this directly

Calls 1

rangeMethod · 0.80

Tested by

no test coverage detected