I now know that you are not supposed to use runBlo...
# coroutines
h
I now know that you are not supposed to use runBlocking from inside coroutines, however I was writing some code with that mistake and found that it worked flawlessly on my OSX machine but failed fairly reliably on a Ubuntu server. Anyone know why that may be?
g
Maybe because of different amount of available CPUs. runBlocking blocks thread of your CommonPool (which has
numCPUs + 1
threads), if you block all threads in CommonPool even non-blocking coroutine will wait for a thread to run. Anyway, maybe you could give more details what is exactly doesn’t work, maybe there is another reason. Actually runBlocking inside coroutines is similar to call of any other blocking function
l
You made a deadlock because the other machine had not enough threads available in CommonPool