Should task groups inherit actor?

They don’t inherit the actor, and I don’t think it would make sense if they did. Child tasks are designed to run concurrently/in parallel. If they all ran on the same actor, they'd have to run one at a time (sequentially or interleaved).

This slide from WWDC 2021: Explore structured concurrency confirms that group tasks and async let don't inherit the actor:

13 Likes