News for hackers. Stuff that matters.
Re:Notes on structured concurrency, or: Go statement conside... by drwiggly on Saturday July 02, 2022 @11:37AM (#31959922)
Its not the same. Anything in the nursery can cause cancellation of all async work. Cancellation is safe to unwind in all workers by scope exit rules.

Completion is just a type of cancellation.

Spawn 10 workers to lookup Dog in 10 different dictionaries, the first one to get the answer wins. This is hard to do with out language/runtime cancellation support.

Note below is a practical lib to get close to this https://blog.labix.org/2011/10/09/death-of-goroutines-under-... .. https://github.com/go-tomb/tomb/tree/v2

Re:Notes on structured concurrency, or: Go statement conside... by swagonomixxx on Saturday July 02, 2022 @11:39AM (#31959947)
You can easily cancel worker goroutines in Go using contexts and their associated cancel functions (listen on ctx.Done() in a select statement).
Re:Notes on structured concurrency, or: Go statement conside... by duped on Saturday July 02, 2022 @01:15PM (#31960738)
> This is hard to do with out language/runtime cancellation support.

It is trivial if the workers can communicate using a shared flag that represents "Dog is found."