so who here is working on a Kotlin (Native) based ...
# kotlin-native
b
so who here is working on a Kotlin (Native) based cross-platform game framework engine? let me know, so I don’t have to.
👍 8
K 11
💥 11
😻 7
s
badlogic: omg native libGDX yes pls best framework that ever existed
o
@badlogic: Mario, it would be truly amazing if it was you 🙂
💯 4
b
welp, let’s wait for threading to arrive in kotlin native 🙂
o
I'm working on threading with following restriction: object subgraphs can be transferred between threads, so that either one or another thread can access it, but not two simultaneously. Would it be sufficient for your needs?
s
What is an object subgraph? How could you ensure that only 1 thread has access to the object at any given time? That seems difficult to restrict.
o
I will follow up with more details, once have viable implementation
2
c
Sounds like an error-prone approach to threading TBH.
b
@olonho I guess one could work with this, however, a single code base for Kotlin Native and Kotlin JVM would be harder to maintain that way. What are the issues with a shared memory model? ref counting not being thread safe?
o
because it raises all the standard issues with MT programming which I find one of the major computer science failures 😉. We believe that coroutines for blocking IO and workers for computation offload is saner approach to concurrency problem in general Take a look on API I sketched in https://github.com/JetBrains/kotlin-native/pull/655/files - would it be sufficient for GDX needs?
s
Do workers have a 1 to 1 relationship with threads?
o
Implementation-wise, there will be a thread bound to the worker, but it is possible to create a thread, and run Kotlin code there, but it doesn't have to be worker, and process its job queue, so I'd say it's an immersion, not isomorphism