In part one of this series, we considered the foundation of Swift concurrency: a multithreading technique that underlies Swift concurrency, the definition of the Task, and the difference between Task, Task.detached, and managing priorities. If you haven’t read this, check it out here. In this part, we are going to explore Structured Concurrency, the relationship between tasks, how to execute multiple simultaneous tasks, working with TaskGroup, and more.
Lightweight Structured Concurrency
In the first part, we considered how the await is a potential suspension point that stops the current execution and brings control to another object until it finishes. But if operations are independent and can be run simultaneously.