Why don't you read the documentation you contacted?
call
Starts to perform this task, waits for its completion, if necessary, and returns its result, or throws a (uncontrolled) RuntimeException or Error if the underlying calculation did this.
It seems to me pretty understandable, waiting for it to complete, if necessary, pretty clearly says that this method is not asynchronous.
will arrive
Waits if necessary to complete the calculation, and then retrieves its result.
This method inherits from Future , this method is similar to join . From javadoc to join :
Returns the result of the calculation when this is done. This method differs from get () in that abnormal termination results in a RuntimeException or Error rather than an ExecutionException, and that interrupting the calling thread does not cause the method to throw throwing InterruptedException suddenly.
So, to use the Fork / Join structure, you need to call fork , which is asynchronous. Then complete the other part of the task locally. Then call join .
The basic premise of the fork framework is that it is used in separation and subjugation algorithms, which can be multi-threaded.
The idea is that you split the task into two discrete units, and then transfer one of them to the other ForkJoinTask via fork - this is done simultaneously with the current Thread . Then you process another block in the current Thread . When you are done, you call join on the first task to make sure you get the result from it.
The invoke call is waiting for the completed task to complete . So your method is now not asynchronous. You simply run all of your parts sequentially, breaking the fork / join point somewhat.
So, if you were to call x.fork().join() , it would be the same as x.invoke() , but the thing is that you are working on the current Thread between calling fork and join .