In this question: Kotlin Coroutines choosing Dispatcher
we can understand to use Dispatcher.Default
on CPU process, like an image/video conversion and Dispatcher.IO
when writing/reading files or API connection.
But in the class Dispatcher.kt
documentation, for the IO
you find this:
* This dispatcher shares threads with a [Default][Dispatchers.Default] dispatcher, so using
* `withContext(Dispatchers.IO) { ... }` does not lead to an actual switching to another thread —
* typically execution continues in the same thread.
So basically they run on the same thread anyway. There is a real difference or in the end it won't matter each one to use?
Thanks!