14.6 Summary
In this chapter, you learned how to apply concurrency in Swift, as well as how to avoid common pitfalls like data races.
Swift supports async functions, which are ideal for operations with unpredictable completion times, such as fetching data from the internet or reading files. Such functions are typically called from within tasks, which are additional threads with individual runtime flows.
An app may have multiple concurrent tasks running simultaneously, each performing a separate operation. You have the option to set higher priorities for more important tasks and to group relevant tasks under a common task group, allowing for easier bulk management.
In any programming language, a typical pitfall for concurrency is a data race ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access