What is a CoroutineDispatcher and when to use Default versus IO?

This tests thread pool selection and the CPU versus IO distinction. A strong answer maps CoroutineDispatcher to the thread pool, Default to CPU work, IO to blocking IO, and Main to the UI thread.
This tests whether you understand how Kotlin coroutines map to threads and the critical difference between CPU-bound and blocking IO work. A strong answer defines CoroutineDispatcher as the thread pool mechanism, Default as a shared background pool for CPU-intensive tasks, IO as an on-demand pool for blocking IO like file or socket operations, and Main as the UI thread. Red flag: recommending Default for blocking IO because it is "background" or treating IO as a general-purpose pool for all async work.
Read the original → kotlinlang.org
- #kotlin
- #coroutines
- #android
- #concurrency
- #dispatchers
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.