https://kotlinlang.org logo
#coroutines
Title
# coroutines
j

Juan Rada

01/08/2019, 12:27 AM
Simple question guys, Given I have a full not blocking data pipeline, is there any case than my application would benefitc from use a coroutines dispacher with greather threads number that server number of processor (as
DefaultDispatcher
) as far as I understant, my threads will be busy all the time as
suspend
operations will not block them so there is not benefits (in terms of pipeline throughput) from more threads, and actually throughput is expected to decrease bacause of new threads context switching.
b

bdawg.io

01/08/2019, 4:08 AM
Suspending is mainly useful for asynchronous Operations that would be wasteful on a thread (particularly IO where a thread is sitting there waiting)
You have to balance parallel throughput with increased memory requirements
u

uli

01/08/2019, 6:43 AM
@Juan Rada your logic seems sound to me. I still suggest to try it out.
3 Views