gildor
10/09/2018, 5:20 AMwe do not need to create our own threads in Android for any reason?@Rohit Surwase I don’t see any common reason even without coroutines create own threads on Android if you not a library author (usually you use ThreadPoolExecutor or some high level primitives) All those cases (1-3) are covered easily by coroutines and provide much better API without drawbacks. Especially if 1 and 2 have async api
Rohit Surwase
10/09/2018, 6:42 AMgildor
10/09/2018, 6:44 AMRohit Surwase
10/09/2018, 6:47 AMgildor
10/09/2018, 6:47 AM<http://Dispatcher.IO|Dispatcher.IO>
that creates new thread (by default up to 64) if you have blocking operation
IO and Default dispatchers have different thread limits, but it’s actually more sophisticated, they share single thread pool to be more efficient and share threads.
See details here:
https://github.com/Kotlin/kotlinx.coroutines/issues/261
For UI/Main thread kotlinx.coroutines provides special dispatchers to dispatch work there (see UI guide)Rohit Surwase
10/09/2018, 6:49 AMgildor
10/09/2018, 6:50 AMbut could not find or understood what I am asking forThere is you can find description of Default dispatcher and link to documentation: Dispatcher docs: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-dispatchers/-default.html
Rohit Surwase
10/10/2018, 6:52 AM