danny
12/06/2018, 7:09 PMCoroutineScheduler
seems far too conservative about parking threads?danny
12/06/2018, 7:11 PMThread.yield
from cpuWorkerIdle
- about double the system CPU time as user time. I must only have a few dozen coroutines runningdanny
12/06/2018, 11:24 PMfun main() {
runBlocking {
val count = AtomicInteger()
val ints = produce<Int> {
repeat(10) {
launch(Dispatchers.Default) {
while (true) {
channel.send(count.incrementAndGet())
}
}
}
}
for (int in ints) {
// Single consumer doing something expensive that can't be concurrent
Thread.sleep(2)
}
}
}
danny
12/06/2018, 11:24 PMdanny
12/06/2018, 11:27 PMdanny
12/06/2018, 11:28 PMVsevolod Tolstopyatov [JB]
12/07/2018, 11:23 AMdanny
12/10/2018, 9:01 PMDispatchers.Default
and not IO
danny
12/11/2018, 6:31 PMdanny
12/11/2018, 6:31 PMVsevolod Tolstopyatov [JB]
12/12/2018, 1:46 PM