https://kotlinlang.org logo
#coroutines
Title
# coroutines
n

napperley

08/20/2019, 10:34 PM
What is the current state of the Kotlin Native version of the KotlinX Coroutines library? Which features are available, and what are the key limitations in the Kotlin Native version?
g

gildor

08/20/2019, 11:25 PM
The main limitation is lack of multithreading
Otherwise everything from kotlinx-coroutines-core should be available for native
n

napperley

08/21/2019, 12:18 AM
Does that include support for the Actor concurrency model?
I might be mistaken but the
delay
function with the Kotlin JVM version relies on threads. Is the
delay
function available in the Kotlin Native version (without the reliance on threads)?
g

gildor

08/21/2019, 12:50 AM
You don't need direct access to thread for delay, you can implement it with event loop, same on JVM
Actors are there, but the same limitation, you cannot pass non-frozen data between threads
n

napperley

08/21/2019, 1:10 AM
That limitation will come from Kotlin Native's memory model.
For back-end development the lack of multi-threading is more of an annoyance than a big pain.
Presumably for all data types (incl custom ones) there will be a straightforward way to create a immutable (frozen) copy of the data.
g

gildor

08/21/2019, 1:30 AM
Yeah I know, I agree with your
5 Views