https://kotlinlang.org logo
e

esdudnik

12/29/2020, 12:05 PM
Hi all. We are using “kotlinx-coroutines-core:1.4.2-native-mt” version. Can we use in that version DIpstachers.Main insteed of custom CoroutineDispatcher with
Copy code
dispatch_get_main_queue
? I can’t find anything in changelogs abouts this. Thanks)
yes black 2
r

russhwolf

12/29/2020, 3:35 PM
There's a docs page in the native-mt branch with more detail about what is and isn't possible with that version. https://github.com/Kotlin/kotlinx.coroutines/blob/native-mt/kotlin-native-sharing.md
A Main dispatcher is properly defined for all Darwin (Apple) targets, refers to the main thread, and integrates with Core Foundation main event loop. On Linux and Windows there is no platform-defined main thread, so Main simply refers to the current thread that must have been either created with newSingleThreadContext or be running inside runBlocking function.
e

esdudnik

12/29/2020, 5:30 PM
Thanks Russell)
6 Views