Prateek Grover
10/31/2019, 11:15 AMkpgalligan
10/31/2019, 12:05 PMkpgalligan
10/31/2019, 12:06 PMPrateek Grover
10/31/2019, 12:08 PMPrateek Grover
10/31/2019, 12:11 PMWe use main thread coroutines backed by workers, and just simple workers with callbacks. Depends how you want to structure itDo you mean that the coroutine is launched on main thread and then the work is switched to workers? Doesn't this requires a lot of freezing of objects? How does mutable objects work in such an environment?
alex009
10/31/2019, 12:12 PMkpgalligan
10/31/2019, 12:22 PMkpgalligan
10/31/2019, 12:24 PMPrateek Grover
10/31/2019, 12:27 PMolonho
10/31/2019, 1:29 PMkpgalligan
10/31/2019, 1:30 PMkpgalligan
10/31/2019, 2:16 PMkpgalligan
10/31/2019, 2:18 PMPrateek Grover
11/01/2019, 4:11 AMelizarov
11/01/2019, 8:24 AMJob
, etc) are not shareable between workers. This is going to change with Kotlin 1.3.60 release. You can already play with it in native-mt
branch. For example, all of the following tests now pass: https://github.com/Kotlin/kotlinx.coroutines/blob/native-mt/kotlinx-coroutines-core/native/test/WorkerDispatcherTest.ktelizarov
11/01/2019, 8:25 AMPrateek Grover
11/01/2019, 8:31 AMelizarov
11/01/2019, 8:44 AMPrateek Grover
11/01/2019, 8:50 AMelizarov
11/01/2019, 9:28 AMPrateek Grover
11/02/2019, 2:42 PMelizarov
11/03/2019, 2:33 PM1.3.60
. You will not be able to use a background queue, though. However, you will be to create a separate worker for your background coroutines with newSingleThreadedContext
function (that will be available) and launch coroutines in this background context, while being able to communicate with the core running in the main queue by transferring immutable objects back and forth.Prateek Grover
11/04/2019, 11:51 AMlouiscad
11/04/2019, 3:26 PMkpgalligan
11/04/2019, 3:28 PMlouiscad
11/04/2019, 3:33 PMdevelop
and master
.
Should I link the workflow file + relevant gradle setup?kpgalligan
11/04/2019, 3:36 PMkpgalligan
11/11/2019, 9:02 PMnewSingleThreadContext
is not found when compiling. Before I go into a deep dive with the config, is there a different dependency here? Currently using the following in the ios dependencies āorg.jetbrains.kotlinxkotlinx coroutines core native1.3.2-native-mt-SNAPSHOTāelizarov
11/11/2019, 9:16 PMkotlin.mpp.enableGranularSourceSetsMetadata=true
in your gradle.properties
kpgalligan
11/11/2019, 9:16 PMelizarov
11/19/2019, 12:01 PMkotlinx.coroutines
version 1.3.2-native-mt-1
for Kotlin/Native (version 1.3.60
) . Make sure to study the docs before using it:
https://github.com/Kotlin/kotlinx.coroutines/blob/native-mt/kotlin-native-sharing.md