Compare commits
No commits in common. "ab8c68d90f96a024d8b2c6b3eab69c95d5b49cd9" and "fbf515f1bb0d15ef5af25a00495c84b6eb3dad49" have entirely different histories.
ab8c68d90f
...
fbf515f1bb
@ -47,10 +47,6 @@ public class Main {
|
|||||||
|
|
||||||
// 关闭线程池
|
// 关闭线程池
|
||||||
forkJoinPool.shutdown();
|
forkJoinPool.shutdown();
|
||||||
|
|
||||||
System.out.println(IntStream.range(0, 1000).parallel().reduce((i, j) -> i + j));
|
|
||||||
System.out.println(IntStream.range(0, 1000).parallel().reduce(Integer::sum));
|
|
||||||
System.out.println(IntStream.range(0, 1000).parallel().sum());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static class RecursiveTaskDemo extends RecursiveTask<Integer> {
|
static class RecursiveTaskDemo extends RecursiveTask<Integer> {
|
||||||
@ -58,7 +54,6 @@ public class Main {
|
|||||||
* 每个"小任务"最多只打印70个数
|
* 每个"小任务"最多只打印70个数
|
||||||
*/
|
*/
|
||||||
private static final int MAX = 100;
|
private static final int MAX = 100;
|
||||||
private static final long serialVersionUID = -134954066152987391L;
|
|
||||||
private final int[] arr;
|
private final int[] arr;
|
||||||
private final int start;
|
private final int start;
|
||||||
private final int end;
|
private final int end;
|
||||||
|
Loading…
Reference in New Issue
Block a user