Problem report on the usage of Structured Concurrency (5th preview)

Alan Bateman alan.bateman at oracle.com
Tue Sep 30 14:18:26 UTC 2025


On 29/09/2025 11:15, Adam Warski wrote:
> :
> Well if scope.join() waits until all forks complete, it will only do so when there are no forks left, and then nobody can create new forks? So I don’t think there’s a race here? In other words, forks can only be created from live forks, before they complete.
That's right but allowing this (as it was in early previews) creates 
weirdness where a subtask can fork it cannot join. It also messes with 
the mental model of "parent".  Who is my parent when I'm forked by a 
sibling?

If the problem has been arranged so that subtask opens a new scope and 
decomposes into a set of sub-subtasks forked in this scope, thus 
creating a hierarchy, then it becomes simpler to reason about.

-Alan


More information about the loom-dev mailing list