> The default dispatcher for runBlocking corout...
# coroutines
l
The default dispatcher for runBlocking coroutine, in particular, is confined to the invoker thread
Is this still true? Isn't
runBlocking
now using
DefaultDispatcher
, which is equal to
CommonPool
on JVM/Android? Quote from here, second paragraph, third sentence: https://github.com/Kotlin/kotlinx.coroutines/blob/master/coroutines-guide.md#unconfined-vs-confined-dispatcher
🤔 1
p
@louiscad That's true for other coroutine builders but if you look at
runBlocking
, its default context is actually
EmptyCoroutineContext
so no dispatcher at all AFAICT, so works like Unconfined I guess. That's also why runBlocking keeps running in the main thread and not on something like a ForkJoinPool worker