Yes.
We can! The Task, being unstructured, runs on the co-operative thread pool, just like any other Swift Task. It does not run on any actor, but what @Douglas_Gregor calls the "sea of concurrency".
This code pattern is a bit unfortunate: it asyncs from your current context into a global thread pool (one thread hop), in order to spawn a Task whose code will run in the cooperative thread pool (another thread hop).
The executor is the default one, the cooperative thread pool.
This is actually two questions, and they have different answers. In the code you wrote above, yes: the two are equivalent.
In general, the answer is no, they are not equivalent. Creating unstructured Tasks via Task.init
does not only inherit actor context, it also inherits task local values. Task.detached
does not.