I have learnt the concepts of Future ,Fork and Join. Can someone explain differences/similarities between these two. Where to apply which concept.
Asked
Active
Viewed 1,311 times
1
-
the most important difference between fork and join is that they perform opposite operations :-D – Leo Feb 24 '14 at 12:41
-
possible duplicate of [How is the fork/join framework better than a thread pool?](http://stackoverflow.com/questions/7926864/how-is-the-fork-join-framework-better-than-a-thread-pool) – Lesto Feb 24 '14 at 12:42
-
you can also try this fine article http://java.amitph.com/2012/08/introduction-to-fork-join-framework.html#.Uws-kPFl7bu – Leo Feb 24 '14 at 12:44
1 Answers
4
It's not really comparable.
A Future represents the result of an asynchronous computation and enables you to access the result of that computation when it's done (possibly in the future if the computation takes some time, hence the name).
A Fork/Join pool is a form of ExecutorService (task execution system) that executes its tasks using multiple threads and uses a work stealing algorithm. The result of a fork/join task is a Future.