Stephen Edwards

Results 35 comments of Stephen Edwards

The workaround (very workable) is: ``` gpg --export-secret-key > secring.gpg ``` So not a big concern I realize.

Discussion in kotlinlang slack here: https://kotlinlang.slack.com/archives/C1CFAFJSK/p1645717325416749

Another way of asking this question with the underlying code would be to say why does `runBlocking` [pull](https://github.com/Kotlin/kotlinx.coroutines/blob/5841effaf9cee6f0839b072bd8aa8e05d01e054e/kotlinx-coroutines-core/jvm/src/Builders.kt#L54) out the `EventLoop` of the `ThreadLocal`? ``` if (contextInterceptor == null) {...

Another, simpler way to demonstrate the unexpected behaviour: ``` runBlocking { println("A. Start ${Thread.currentThread()}") launch { println("B. Start scheduled coroutine. ${Thread.currentThread()}") yield() println("C. Finish scheduled coroutine. ${Thread.currentThread()}") } println("D. Before...

And a simpler reproduction of the original case: ``` val testCoroutineDispatcher = TestCoroutineDispatcher().apply{ pauseDispatcher() } runBlocking { println("A. Start ${Thread.currentThread()}") launch { println("B. Start scheduled coroutine. ${Thread.currentThread()}") yield() println("C. Finish...

Thinking about this more .... runBlocking is supposed to block the calling thread but to do so it [tries](https://github.com/Kotlin/kotlinx.coroutines/blob/5841effaf9cee6f0839b072bd8aa8e05d01e054e/kotlinx-coroutines-core/jvm/src/Builders.kt#L85) to use the EventLoop of the calling thread to run other...

> it progress all the coroutines that have been dispatched to this runBlocking loop. Yes this makes sense to me and is necessary - my issue is that it _also_...

> Meaning that when you have more than one library that use runBlocking and call each other, this will become a huge issue with potential deadlocks that cannot be workarounded...

> Can someone confirm this is correct (and thus that my interpretation of @qwwdfsad is correct). I know that's what the code does, but would like confirmation that is the...

@arberg no that is wrong and that is exactly what my example is showing. when `runBlocking` suspends other coroutines launched outside of its 'job tree' on that same thread can...