Is there any option to generate purely single-thre...
# kotlin-native
i
Is there any option to generate purely single-threaded code? For my use cases, I feel like it might be easier to make stuff work in one thread than to debug multithreading issues.
s
Copy code
newSingleThreadContext("main").use { ctx ->
  val a = runBlocking<A>(ctx) {
    fa()
  }
}
👍 1
i
Interesting, thanks!
j
you may want to try out new-memory concurrency it supposedly removes freezing.
i
@jimn I had a look at the docs, that might be a winner! Although it’s a bit scary that it’s changing so much
j
so far so good here on linux native C p_thread code talking to the kernel. i backed off the available pthread testing samples when i ran into the freeze barriers but came back to it and currently have new-memory build that succeeds with original pthread code out of the box.