Kotlin Multiplatform multithreading old and new way
summary
Kotlin Multiplatform concurrency historically forces Kotlin/Native code to use freezing and custom dispatchers to avoid frozen-exceptions; the talk shows a working HTTP client built on iOS URLSession that uses Workers plus an atomic-reference byte buffer and explicit clearing to avoid leaks, and explains detached object graphs, channels/flows and CompletableDeferred for lambda/callback bridging. The claimed payoff: with the new memory model (enable kotlin.native.binary.memoryModel=experimental) freezing is removed, default dispatchers work on iOS and multi-threaded GC fixes the main failure modes.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:30Kotlin Multiplatform overview
- 5:26Old concurrency approach
- 10:48Thread safety in Kotlin Native
- 14:41Native tools for concurrency
- 23:39Detached object graph
- 25:26Combining coroutines with flows
- 28:22New memory model introduction
- 32:18Migrating to new model
- 34:51Benefits of new model
- 37:42Flows in Kotlin Multiplatform
- 40:54Summary and Q&A
related talks
58mKotlin Multiplatform: Memory management old and new way
44mKotlin/Native Concurrency for Mobile Multiplatform
39mKotlin Native Concurrency Explained
39mKotlin Native Concurrency Explained
46mKotlin/Native Concurrency Model
41mCoroutines for Kotlin Multiplatform in practise
36mKotlin Multiplatform at five years
26mKotlin/Native for Multiplatform Development
