I made a branch on my toy-project that receives sensor data on the main thread and then do the work with a KN worker instead. However, the GyroSumComputer which needs to be an input to the worker cannot be frozen (in the real world it is a complicated filter with buffers and states that need to change). All work must be performed sequentially, so there is really no concurrency problem. I just can’t do all the work on the main thread. How is the best practice for this kind of situation?
See my worker class here:
https://github.com/dtornqvist/kotlin-native-threading-debug/blob/kotlin-native-worker/MySimpleProject/KotlinNativeFramework/src/main/kotlin/GyroSumWorker.kt