1 2 3 4 5
| public static void main(String[] args) { int[] a = {0, 1, 2, 3, 4, 5}; Arrays.stream(a).parallel().forEach(v -> System.out.println(Thread.currentThread().getId() + "==" + v)); System.out.println("FockJoin 默认线程池线程数量 = " + (Runtime.getRuntime().availableProcessors() - 1)); }
|