Following are the available CoroutineDispatchers :
Main
Main Dispatcher schedules coroutines on the single Main thread available to all applications. For UI applications, UI related operations are performed on the Main thread.
IO
IO Dispatcher schedules coroutines on a shared pool of threads (64 by default) for offloading blocking IO tasks such as making network requests, reading / writing file, managing hardware etc. It is suitable for tasks where coroutine might suspends during execution. For example, when waiting for a network request’s response.
Default
Default Dispatcher schedules coroutines on a shared pool of threads (at least 2 and at most equal to number of CPU cores). It is suitable for CPU intensive tasks where coroutine barely need to suspend.
Unconfined
Unlike above three Dispatchers that restrict coroutine execution to a specific thread / thread pool, Unconfined dispatcher does not restrict. Till the first suspension point, caller thread is used and after the coroutine resumes, any available thread may be used.