Am I right in thinking that this, which I totally didn't write, will permanently tie up one of the few Default threads, and that four of these running on a 4-core machine would prevent any coroutines from running on Default?
As long as there is no long blocking operation done on the threads, it's not a problem per se. Collecting a stateflow never ends, indeed. But every iteration in the
collect
call has a suspension point, so the thread is regularly yielded to other coroutines (they can interlace freely)
Joffrey
12/03/2021, 11:18 PM
You could technically have concurrency even with 1 thread this way