4 ms·
You're probably right that my rough sketch for a proof wouldn't work. That said, first of all, I don't think structured concurrency has to be a tree. I think i
by gavinhoward 5y ago
You're probably right that my rough sketch for a proof wouldn't work.
That said, first of all, I don't think structured concurrency has to be a tree. I think it can be a DAG. See my comment at [0].
To solve the main(), quux(), foo() problem, just have main() open a threadset, spawn quux(), then call a function while the threadset is still open, and in that function, open another threadset that spawns foo().
The main(), foo(), bar() problem is a problem of cancellation. In that one, I believe that foo() should not return until bar() does. And if you need to cancel, use deadlines. That is why my code has cancellation built-in, with timers to implement deadlines. (Well, it's still alpha, but the rough shape of it is there.)
[0]: https://lobste.rs/s/8msejg/notes_on_structured_concurrency_go#c_wkxbvb https://lobste.rs/s/8msejg/notes_on_structured_concurrency_g...