Roman Elizarov
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

--

--

Roman Elizarov
Roman Elizarov

Written by Roman Elizarov

Project Lead for the Kotlin Programming Language @JetBrains

No responses yet