Sobes.tech
Junior — Middle

When using unconfined in coroutines, in which thread does their start initialization occur?

sobes.tech AI

Answer from AI

When using the Dispatchers.Unconfined dispatcher in Kotlin coroutines, the coroutine's initial start and initialization occur in the same thread that launched the coroutine. This means that the coroutine begins execution immediately in the current thread until the first suspension. After the first suspension, the continuation of the coroutine may resume in a different thread chosen by the scheduler, for example, in the thread where the suspended operation was completed.

When using unconfined in coroutines, in which thread… - sobes.tech