Swift by Sundell cover image

99: “Structured concurrency”, with special guest Doug Gregor

Swift by Sundell

CHAPTER

How Does Async Await Work?

Each actor instance has its own like lightweight serialization mechanism in it. And so when you when you try to call a method on the actor from sort of outside the actor, either the actor might be free already. It's not doing any work, in which case you could just run immediately and even on the same operating system thread. So there's no overhead if the actor is already free. You just sort of take ownership of the actor, run your code on it until it it leaves that actor and then the actors free to do other work.

00:00
Transcript
Play full episode

Remember Everything You Learn from Podcasts

Save insights instantly, chat with episodes, and build lasting knowledge - all powered by AI.
App store bannerPlay store banner