After reading some RxJava articles i mentioned that all authors recommend use Schedule.computation only for hard CPU jobs, while Scheduler.IO looks as better option for everything else (IO operations itself, callbacks execution, data mutation etc) because execution doesn’t stop if all continuation threads are busy.
So my question is, why in coroutines default dispatcher is Dispatcher.Default? As I understand it has the same behavior as Scheduler.computation and it means same problems. Maybe I’m missing something. Can you explain please?
I already have an answer here: https://github.com/Kotlin/kotlinx.coroutines/issues/2410 but it’s still not clear for me.
So if Dispatcher.Deafult should be used only for small computations why library doesn’t contain dispatcher for long computations? Otherwise it’s easy to block default execution. I will run 8 launch with some loop computation and the 9th launch will block. But if I’ll launch 9th coroutine on Dispatcher.IO it will work.
I understand that for common tasks using Dispatcher.Deafult is better option for system resources optimization, but if I will run my code on 2 cores device it can bring some problems.
So that should I do if my Android application pretty complicated and has some parts with long computation blocks?