The Java Fork/Join framework is meant to simplify parallel programming in Java. It allows the pattern of forking an algorithm into several parallel tasks and then joining the results to be abstracted out by the developer.
I found it interesting that they left it up to the developer to still determine when to actually use separate threads. This makes it useful if you know that for some threshold the algorithm can be solved faster than with separate tasks, you can use the alternative method rather than a full task.
The authors implemented this in Java and showed that garbage collection is a major hit as the the number of threads grows, due to the pausing of all threads when the collector is running. I think this same kind of framework can be written on modern OSes in a faster language, but it will not be as portable as the given solution. For example, on Windows one could use Fibers or other smaller units than threads if needed.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment