kotlin-native/NEW_MM.md: mention the new release of the coroutines

This commit is contained in:
dkhalanskyjb
2022-01-10 13:38:01 +03:00
committed by GitHub
parent 276dcfb4a7
commit ac8553cfd4
+2 -2
View File
@@ -58,14 +58,14 @@ If `kotlin.native.isExperimentalMM()` returns `true`, you've successfully enable
### Update the libraries
To take full advantage of the new MM, we released new versions of the following libraries:
* `kotlinx.coroutines`: `1.5.1-new-mm-dev2` at https://maven.pkg.jetbrains.space/public/p/kotlinx-coroutines/maven
* `kotlinx.coroutines`: `1.6.0` (will automatically detect when running with the new memory model).
* No freezing. Every common primitive (Channels, Flows, coroutines) works through `Worker` boundaries.
* Unlike the `native-mt` version, library objects are transparent for `freeze`. For example, if you freeze a channel, all of its internals will get frozen, so it won't work as expected. In particular, this can happen when freezing something that captures a channel.
* `Dispatchers.Default` is backed by a pool of `Worker`s on Linux and Windows and by a global queue on Apple targets.
* `newSingleThreadContext` to create a coroutine dispatcher that is backed by a `Worker`.
* `newFixedThreadPoolContext` to create a coroutine dispatcher backed by a pool of `N` `Worker`s.
* `Dispatchers.Main` is backed by the main queue on Darwin and by a standalone `Worker` on other platforms.
_Don't use `Dispatchers.Main` in unit tests because, in unit tests, nothing processes the main thread queue._
_In unit tests, nothing processes the main thread queue, so do not use `Dispatchers.Main` in unit tests unless it was mocked, which can be done by calling `Dispatchers.setMain` from `kotlinx-coroutines-test`._
* `ktor`: `1.6.2-native-mm-eap-196` at https://maven.pkg.jetbrains.space/public/p/ktor/eap
### Using previous versions of the libraries