Stefan Oltmann
06/08/2022, 2:57 PM@SharedImmutable
private val backgroundDispatcher: CoroutineDispatcher = Dispatchers.Default
and it looks like that every Job started by backgroundDispatcher.launch()
runs on the same NSThread. I use 1.6.1-native-mt
. The same code on JVM runs every job on another thread.
Do I have to do something extra to get this parallel?mkrussel
06/08/2022, 3:03 PMmt
branch Dispatchers.Default
is single threaded on native, it's just a different thread than the main thread.Stefan Oltmann
06/08/2022, 3:04 PMStefan Oltmann
06/08/2022, 3:05 PMmt
stands for *m*ulti*t*hreading 🙈Mitchell Syer
06/08/2022, 3:07 PM1.6.1
and use the new memory model https://github.com/JetBrains/kotlin/blob/master/kotlin-native/NEW_MM.mdStefan Oltmann
06/08/2022, 3:09 PMStefan Oltmann
06/08/2022, 3:39 PMonly for evaluation purposes
... I want to ship my app in a few weeks and right now I try to tune performance.xiaobailong24
06/08/2022, 5:51 PMStefan Oltmann
06/09/2022, 6:49 AMxiaobailong24
06/09/2022, 10:17 AMxiaobailong24
06/09/2022, 10:19 AMStefan Oltmann
06/09/2022, 10:21 AMStefan Oltmann
06/13/2022, 3:04 PMxiaobailong24
06/13/2022, 3:33 PMStefan Oltmann
06/13/2022, 8:03 PMnative-mt
to load some work like metadata extraction and thumbnail creation to multiple NSThreads. I tried the normal variant (without experimental support), but that one does not work at all.
So I'm now in the situation where I can't multithread anything that is related to REST API communication (since KTor doesn't work), but I can speed up some of the other things.
I guess for my first release this will have to be good enough and as soon as the new memory model becomes production ready I can solve the rest of my performance issues.
Again, thank you for your help.