https://kotlinlang.org logo
Title
b

badlogic

06/05/2017, 10:46 AM
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
:kotlin: 11
💥 11
😻 7
s

sksk

06/05/2017, 11:55 AM
badlogic: omg native libGDX yes pls best framework that ever existed
o

olonho

06/05/2017, 12:54 PM
@badlogic: Mario, it would be truly amazing if it was you 🙂
💯 4
b

badlogic

06/05/2017, 12:58 PM
welp, let’s wait for threading to arrive in kotlin native 🙂
o

olonho

06/05/2017, 1:05 PM
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

spierce7

06/05/2017, 10:32 PM
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

olonho

06/06/2017, 4:54 PM
I will follow up with more details, once have viable implementation
2
c

cbruegg

06/07/2017, 2:35 PM
Sounds like an error-prone approach to threading TBH.
b

badlogic

06/14/2017, 11:10 AM
@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

olonho

06/14/2017, 12:52 PM
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

spierce7

06/14/2017, 8:27 PM
Do workers have a 1 to 1 relationship with threads?
o

olonho

06/15/2017, 5:33 AM
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