Difference between recursive task and recursive action in ForkJoinPool Difference between recursive task and recursive action in ForkJoinPool multithreading multithreading

Difference between recursive task and recursive action in ForkJoinPool


From the first lines of their respective Javadocs:

Although technically, RecursiveAction does return a value, it's just always null, because it's a ForkJoinTask<Void>, and that's the only possible value of Void.


They are alike except RecursiveTask returns a result while RecursiveAction has no return value.