Modern Concurrency: Beyond the Basics

Oct 20 2022 · Swift 5.5, iOS 15, Xcode 13.4

Part 2: Concurrent Code

11. Introduction

Episode complete

Play next episode

Next
About this episode

Leave a rating/review

See forum comments
Cinema mode Mark complete Download course materials
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.

Learn more Already a subscriber? Sign in.

Transcript: 11. Introduction

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 pretty 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 2 introduces TaskGroup for truly dynamic concurrency.

Concurrency brings the possibility of data races, so you’ll go beyond MainActor and learn how to use the Actor API to make your code thread safe.

You can safely use a default, shared instance of MainActor 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’ll 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.