Daily iOS
Concurrency

How Task runs

In Swift Concurrency, when you create a Task { }, when and where does that code run?

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

Task { } is an unstructured task that's scheduled right away; it inherits the actor context, priority, and task-local values from where it was created and runs on that actor (or the cooperative thread pool). There's no parent-child relationship, and detached inherits nothing.

Share a question