Even though the fork/join framework is relatively easy to use, unfortunately it’s also easy to misuse. Here are a few best practices to leverage it effectively:
- Invoking the join method on a task blocks the caller until the result produced by that task is ready. For this reason, it’s necessary to call it after the computation of both subtasks has been started. Otherwise, you’ll end up with a slower and more complex version of your original sequential algorithm because every subtask will have to wait for the other one to...
- Chapter 7. Parallel data processing and performance
- from Java 8 in Action: Lambdas, streams, and functional-style programming
- Publisher: Manning Publications
- Released: August 2014
Best practices of how to use Fork\Join pool
Share this highlighthttp://www.safaribooksonline.com/a/java-8-in/5201224/