Loom on Scala

Alan Bateman Alan.Bateman at oracle.com
Sun Nov 28 09:14:27 UTC 2021


On 28/11/2021 01:19, Paul Bjorkstrand wrote:
> :
> I could see an additional parameter flag for StructuredExecutor.open()
> which changes the shutdown implementation from the default "interrupt" to
> "wait" aka join.
I suspect you mean "close" rather than "shutdown" here. Having shutdown 
wait would be very deadlock prone (a task would be waiting on itself 
and/or several tasks calling shutdown would deadlock waiting on each other).

We've avoided having a configurable parameter to change the close 
behavior. The behavior in the current prototype (where close is 
specified to shutdown) is more useful for cases where there is an 
exception in the block and you fall into the close. It avoids having 
close waiting indefinitely for tasks that you are no longer interested in.

-Alan


More information about the loom-dev mailing list