I read a few weeks ago that the current threading ...
# kotlin-native
s
I read a few weeks ago that the current threading model in kotlin-native would probably not be the same model with the 1.0 release. Has that been discussed any further, and are there any details about what may change before the official release?
m
A week ago there was talk by Andrey Breslav (in Russian) stating that multithread memory model in Kotlin/Native probably will be combination of thread and process models - common immutable data and only thread-local mutable data, and some message passing. So like threads for immutable and like process for mutable. Because it better fits to modern CPU desingn with multiple cores and core-local caches.
s
is there video of that talk ?
m

https://youtu.be/XFmZq8RxAiw

s
is there any version of this talk in English? ^^
👍 2
s
thanks
j
I started a thread in the forums regarding similar questions/problems but nobody answers there. Is this the official place to ask and the forum should be ignored?
m
I think better ask here or create issue on github https://github.com/JetBrains/kotlin-native/issues
o
Threading is not something explicitly defined in Kotlin as a language, so we are trying to come up with the “least surprise, most coding efficiency” approach. Current TLS globals approach is easy to implement, but may be not very memory-efficient. So we may refine it along lines of adding elements of globally visible immutable state and maybe, additional user-visible mutable -> immutable transition mechanisms. Nothing is yet finally decided. However, current K/N programs relying on workers and ownership transfer most likely will continue to work.
n
Not all platforms support multi-threading (eg uCs and some other embedded devices) so Coroutines are the only option on these platforms.
g
Damn that video is interesting to watch - I speak another slavic language and at the micro level I recognize a lot of the words; on the macro level, I have no fucking idea what he's saying 😄