1 min readMar 23, 2018
yield
is a suspending function and it uses synchronization when moving the coroutine to another thread to establish happens before relation between its invocation (suspension) in one thread and its return (resumption) in another thread. You can get a more information from my JVMLS talks that covers some JVM-specific implementation details https://www.youtube.com/watch?v=3xalVUY69Ok