ExecutorService - goto in disguise?

Pedro Lamarão pedro.lamarao at prodist.com.br
Fri May 20 21:33:22 UTC 2022

Em sex., 20 de mai. de 2022 às 18:01, Arkadiusz Gasiński <jigga at jigga.pl>

> Any code with a reference to a Future can join it (i.e., await its result
> > by calling get()), even code in a thread other than the one which
> > obtained the Future. In effect, *a subtask started by one task does not
> > have to "return" to the task that submitted it*; it could "return" to any
> > number of tasks, or even none.
> Especially the bolded part, which, to some extent, sounds like "the called
> method does not have to return to the callee" (when you have a construct
> like goto in your language).

> Agree, disagree?

What is there to disagree with?
A Future may be freely passed around.
There is no structural constraint requiring a Future to be joined-with by
its "caller".

Pedro Lamarão

More information about the loom-dev mailing list