Concurrency 101

More Interesting Topics

Task Groups

Summary

Does taskGroup.cancelAll() require active co-operation to finish properly?

Race Conditions May Occur When Setting Properties

Summary

Post

Structured concurrency

Beyond the basics of structured concurrency

Cooperative vs preemptive multitasking

Summary

Benefits of cooperative multitasking

Swift Running on C Threads

Summary

Post

Invisible Suspension Points

Summary

Serial Executor

Summary

Suspending/Resuming Tasks by Using Continuations

Summary

Note that my surprise was not about the requirement of active participation of the "child" (which was not, in fact a child). The community has done a good job driving home the fact that you have to participate in cancelation.

What got me was that the task group itself, couldn't return from the await where it was created until all the subtasks had actively co-operated. I just imagined it could return and its child tasks would finish (or not) at some point.

Indeed, the documentation on one version of task group was careful to spell this out, unfortunately, it was the version I wasn't using...