When I run the following code and add some breakpoints to view the thread the tasks run on, I see tasks not under a specific thread. (see screenshot)
Questions
Does this mean that task is not associated with any specific thread?
Is this behavior (of Task not associated with any thread) new to Swift 6.2 / Xcode 26 or has it always been the case since introduction of swift concurrency?
Is the following statement from Google search AI overview correct?
In Xcode 26, when working with Swift concurrency, tasks are managed by a cooperative thread pool, not directly tied to specific threads. This means tasks are executed concurrently, potentially switching between threads as needed, but the system handles the thread management for you. Xcode 26 also introduces improvements for debugging Swift concurrency, allowing stepping through asynchronous functions and displaying task IDs.
Or am I missing something?
Build Settings / Configuration
Approachable Concurrency: Yes
Default Actor Isolation: Main Actor
Strict Concurrency: Complete
Toolchain: Swift 6.2 development snapshot 2025-06-14 (a)
Code
import Foundation
@concurrent
func printNumbers() async {
for index in 1...100 {
print(index)
}
}
Task {
async let _ = await printNumbers()
async let _ = await printNumbers()
async let _ = await printNumbers()
async let _ = await printNumbers()
}
RunLoop.main.run()
This was always the case; A task is not associated with a specific thread. The one exception to that is tasks running on the main actor, but that's because the main actor's executor is special and uses only the main thread.
So in other words: tasks run on some specific executor, if running on an actor, that'll mean running on that actor's executor. The mainactor's executor is special and tied to a specific thread, generally though, tasks are not bound to a specific thread.
You could write your own executor which would use some other specific thread if you wanted to.