What is the `SWIFT_CONCURRENCY_TASK_TO_THREAD_MODEL`?

in various places throughout the concurrency runtime sources there are references to this configuration. i've been wondering – what does it mean/do exactly? based on the name and bits i've pieced together from the source code, it seems that it's an alternate model for the concurrency runtime, one in which i would guess that Tasks are somehow bound to specific threads or something. seems it is maybe not very relevant for Darwin, but is it used for other platforms today? are there any docs on the differences between this and the 'standard' concurrency model?

3 Likes

Two more pieces of information I found. First, I strongly suspect that “SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY” and “SWIFT_CONCURRENCY_TASK_TO_THREAD_MODEL” refer to the same thing. it appears this was added in Swift 5.8, since I found a compiler flag -Xfrontend -concurrency-model=task-to-thread that the compiler has recognized since 5.8. However, it doesn’t seem to have any effect.