Questions
KotlinIntermediate4 min
Dispatchers.Default vs Dispatchers.IO?
Answer
| Feature | Dispatchers.Default | Dispatchers.IO |
|---|---|---|
| Optimized For | CPU-intensive tasks | Blocking I/O tasks |
| Thread Pool | Fixed size (Num Cores) | Elastic size (up to 64+) |
| Examples | Sorting, JSON parsing, DiffUtils | API calls, DB queries, File I/O |
Key Difference: `IO` can create many more threads because I/O tasks spend most of their time waiting. `Default` limits threads to CPU cores to keep the processor efficient.
1:1 Mentorship
Get personalized guidance from a Google Developer Expert. Accelerate your career with dedicated support.
Personalized Learning Path
Mock Interviews & Feedback
Resume & Career Guidance
Share & Help Others
Help fellow developers prepare for interviews
Sharing helps the Android community grow 💚