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

Method main

lowlevel/WorkStealingPool.java:16–26  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

14
15public class WorkStealingPool {
16 public static void main(String[] args)
17 throws InterruptedException {
18 System.out.println(
19 Runtime.getRuntime().availableProcessors());
20 ExecutorService exec =
21 Executors.newWorkStealingPool();
22 IntStream.range(0, 10)
23 .mapToObj(n -> new ShowThread())
24 .forEach(exec::execute);
25 exec.awaitTermination(1, TimeUnit.SECONDS);
26 }
27}
28/* Output:
298

Callers

nothing calls this directly

Calls 1

rangeMethod · 0.80

Tested by

no test coverage detected