What is the difference between get () and invoke () in Java 7 ForkJoinTask?
Here is the javadoc for both:
- get (): waits, if necessary, for the computation to complete, and then retrieves its result.
- invoke (): Starts the execution of this task, waits for it to complete if necessary and returns its result, or throws a RuntimeException or Error if the main computation did so.
+3
source to share