Dispatchers.Default is the general-purpose choice for coroutine execution. It uses a thread pool sized to the available CPU cores, allowing work to run across multiple threads and in parallel on multicore machines. section 14.7.1
Select the default dispatcher explicitly
withContext(Dispatchers.Default) { // general-purpose or CPU-bound coroutine work } Use Dispatchers.Default when a coroutine needs no UI-thread confinement, blocking-API handling, or other specialized dispatcher. Coroutines suspend instead of blocking their worker threads, so the pool can support many suspended coroutines. section 14.7.1 section 14.9
Choose another dispatcher only when the work has a specific execution requirement:
- Use Dispatchers.Main for operations that must run on a UI or main thread. section 14.7.1
- Use Dispatchers.IO for APIs that inherently block threads. section 14.7.1
- Use Dispatchers.Default as the starting point when no special constraint applies. section 14.7.1
