Workers is essentially the only way to run some operation on another thread which is available on K/N (without usage of pthread and other platform specific features, so it’s the only common way to do that), kotlinx.coroutines not even released with support of concurrency, it’s under active development I don’t see how it can be compareed, and it’s a separate library, after all
n
napperley
06/08/2020, 5:00 AM
You can do concurrency with KotlinX Coroutines with the limited number of Kotlin Native targets that are supported (one of the supported targets is linuxX64).
napperley
06/08/2020, 5:02 AM
Is there a basic Worker example (not mobile related) available that covers running multiple tasks in parallel?
g
gildor
06/08/2020, 5:08 AM
Yes, you can, but it not even released for K/N, right?
gildor
06/08/2020, 5:09 AM
If you do not get any parallelism for Arm32Hfp it probably not supported, so fallback to single thread execution, I would just create an issue/feature request on Kotlin tracker
n
napperley
06/08/2020, 5:24 AM
How would I be able to tell if the linuxArm32Hfp has multi-threading support?
g
gildor
06/08/2020, 5:59 AM
what do you mean? I though that you tried worker and it executes on the main thread on arm32hfp, isn’t it?
t
Tijl
06/08/2020, 6:54 AM
@napperley while there is coroutines support on some native targets, it is essentially single threaded, since coroutine internals can not handle freezing (yet). You would also have to write your own dispatcher.