4

如何高效的使用并行流-mb5fccdc91d7e3e的博客

 3 years ago
source link: https://blog.51cto.com/15049004/2562891
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
在Java7之前想要并行处理大量数据是很困难的,首先把数据拆分成很多个部分,然后把这这些子部分放入到每个线程中去执行计算逻辑,最后在把每个线程返回的计算结果进行合并操作;在Java7中提供了一个处理大数据的fork/join框架,屏蔽掉了线程之间交互的处理,更加专注于数据的处理。Fork/Join框架Fork/Join框架采用的是思想就是分而治之,把大的任务拆分成小的任务,然后放入到独立的线程中去

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK