dekans
04/25/2018, 9:32 AMpetersommerhoff
04/25/2018, 9:34 AMCoroutineStart.UNDISPATCHED
to start execution immediately (until first suspension point)dekans
04/25/2018, 9:38 AMelizarov
04/25/2018, 9:39 AMgildor
04/25/2018, 9:41 AMelizarov
04/25/2018, 9:42 AMdekans
04/25/2018, 10:00 AMelizarov
04/25/2018, 10:01 AMdekans
04/25/2018, 10:04 AMgildor
04/25/2018, 10:14 AMIn Java I set priorities for my threadpool, I’ve been fooled all this timeIf you do that on Android yes, it’s useless
My use case is list updates (priority) vs list items images loading potentially flooding the CommonPoolBut how this related to CommonPool? I just don’t see how you can achieve this with different dispatchers, bottleneck is network, not CPU, so all those thread priorities are useless for this case. Also, if you use something like okhttp with async API it has own thread pool under the hood for “non-blocking” requests with own strategy (limit amount of parallel requests per host)
dekans
04/25/2018, 10:42 AMgildor
04/25/2018, 10:47 AMIt’s loading images from local storageso it’s blocking IO operation and shouldn’t be done in CommonPool Until we have non-blocking IO on Android, special IO dispatcher is the only option
dekans
04/25/2018, 10:52 AMgildor
04/25/2018, 10:55 AM<http://Schedulers.io|Schedulers.io>()
for network and IO and Schedulers.computation()
for computationdekans
04/25/2018, 10:57 AMCommonPool
gildor
04/25/2018, 10:57 AMdekans
04/25/2018, 10:59 AMDiffUtil.calculateDiff
, in my becnhmarks, the most I got was around 130ms with a Gaxaxy S1 on a 1300+ items listelizarov
04/25/2018, 11:14 AMgildor
04/25/2018, 2:10 PMwithoutclass
04/25/2018, 2:43 PMyield()
properly? For instance, every database/io call, I run in a block that always yields after the IO operation.gildor
04/25/2018, 2:46 PMlimited number of threads, it’s better to use a special dispatcher for IOlimited number of threads? What do you mean? If IO is blocking than better to use special dispatcher that would be safe to block (at least you expect that this dispatcher can be blocked) There is proposal to change threading strategy and use single pool of threads for different dispatchers: https://github.com/Kotlin/kotlinx.coroutines/issues/261
withoutclass
04/25/2018, 3:09 PMgildor
04/26/2018, 1:06 AMdekans
04/26/2018, 8:08 AM