if you don’t do context switching and, as you said, same thread, it is okay for coroutine to move your code block to the end of the block stack, so it won’t run, until previous block is finished
m
Maciek
07/21/2020, 5:48 PM
ooh, that makes sense, thanks!
l
Lukas Lechner
07/29/2020, 2:51 PM
If thats on Android then launching a coroutine on the main thread is like posting a runnable to the message queue of the main thread and this can take some time if it is able to process your runnable. I think there is
Dispatchers.Main.immediate
that executes your launched coroutine immediately.