Daily iOS
Concurrency

How async/await works

In Swift Concurrency, what actually happens when execution hits an await, and how is that different from blocking a thread?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

await suspends the function and gives the thread back to the pool, then resumes through a continuation once the result is ready. Unlike blocking a thread, it handles thousands of tasks with as many threads as there are cores.

Share a question