fork/join branch/merge using

1. jdk1.7 adds fork/join branch/merge for recursive parallelism. The parallelism of streams in jdk1.8 is based on this. The recursive parallel method is: divide one into two, divide two into four, and divide into eight. When eight tasks are divided, it is found that these eight tasks cannot be divided any more. These eight tasks are executed in parallel and sequentially, and the execution results are combined. Layers are recursively merged to obtain the final result and achieve parallelism. Below is the code directly:
insert image description here
insert image description here
insert image description here
The above is a summation parallel code.

Guess you like

Origin blog.csdn.net/u013326684/article/details/102710512