[concurrency-interest] RecursiveTask and asynchronous waiting for completion

Doug Lea dl at cs.oswego.edu
Fri Jan 12 09:37:10 EST 2018

On 01/12/2018 06:27 AM, Peter Veentjer via Concurrency-interest wrote:
> If has a RecursiveTask and on completion I need to take an action.
> However, I don't want to block the thread by calling task.join.

You could use CountedCompleter rather than RecursiveTask.
It provides simple and efficient but hard-to-use completion chaining.
Or recast as CompletableFuture, which was introduced in part because
CountedCompleters are hard to use.


> So how can one listen to the completion of a RecursiveTask and then take
> an action? So comparable like the CompletableFuture.thenApply.

More information about the Concurrency-interest mailing list