Learn how to use TaskGroup for truly dynamic concurrency and how to use the Actor API to make your code thread-safe. Learn about the apps you’ll build in this part of the course and the Swift concurrency tools you’ll use.
Learn how to use TaskGroup for truly dynamic concurrency and how to use the Actor API to make your code thread-safe. Learn about the apps you’ll build in this part of the course and the Swift concurrency tools you’ll use.
Cinema mode
Mark complete
Download course materials
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Previous episode: Part 1 Quiz: AsyncStream & Continuations
Next episode: 12. TaskGroup
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
Welcome back to our course Modern Concurrency Beyond the Basics. In Part 1, you learned about AsyncStream, unit testing, and continuations. At this point, you're hopefully comfortable with designing code with async await, creating asynchronous sequences, and running tasks in parallel with async let bindings. Async let concurrency doesn't scale up beyond a few tasks. Also, what if you don't know exactly which tasks you want to run in parallel? Part two introduces TaskGroup for truly dynamic concurrency. Concurrency brings the possibility of data races, so you go beyond main actor and learn how to use the actor API to make your code thread safe. You can safely use a default shared instance of main actor from anywhere whenever you need to make quick changes that drive the UI. There are other times you need an app-wide single instance shared state like a database layer or an image or data cache. You create a global actor to provide a persistent on disk image cache that allows easy and safe access to shared resources from anywhere in your app. Let's get started.
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.