We break down the difference between
suspension and thread blocking, why JVM file operations are most often blocking, and how this directly affects the choice of coroutine context: where to use
Dispatchers.Default, and where to use
Dispatchers.IO. Using examples with
withContext,
async, and the blocking
Thread.sleep, we show how “accidental I/O on Default” can slow down CPU tasks, and how the discipline “I/O separately, CPU separately” simplifies architecture.