Kotlin & Coroutines (50 Qs)•Part 2: Coroutines, Flow & Concurrency Architecture (11 - 24)
What is the difference between Dispatchers.Default, Dispatchers.IO, and Dispatchers.Main?
senior LevelSystem Design
In Simple Words:
Dispatchers.Default: Sized to CPU core count ($N$ threads). For CPU-intensive tasks (sorting, JSON parsing).Dispatchers.IO: Dynamically scales up to 64 threads. For blocking I/O (files, network, database).Dispatchers.Main: Single UI thread on Android.