Kotlin Native Concurrency Explained
summary
Explains Kotlin Native’s concrete runtime rules: mutable state visible to one thread, worker queues with execute/producer/transfer-mode API, and the freeze API that makes an object graph immutable and shareable. Shows patterns used in a real Droidcon app: Atomics and a frozen-delegate wrapper, a background-worker library, and why detached object graphs are rare. Notes a multi-threaded coroutines PR landed days before the talk, relaxed mode exists as an experimental compiler option, and recommends the Stately library and KaMP-Kit for practical examples.
AI-written summary · about
chapters (18)
- 0:00Introduction and background
- 1:34Kotlin multi-platform overview
- 3:01Why concurrency is hard
- 5:25Kotlin Native concurrency model
- 7:08Core rules of mutable state
- 9:36Worker concurrency primitive
- 13:08Freezing and thread safety
- 17:49Debugging frozen state issues
- 21:44Global state and thread confinement
- 24:13Atomics and mutable frozen state
- 26:16Detached object graph
- 28:00Thread confined state tips
- 30:05Multi-platform state handling
- 31:27Architecture changes in apps
- 33:15Next steps and resources
- 35:04Relaxed mode and future
- 36:27What to do today
- 37:50Resources and contact
related talks
39mKotlin Native Concurrency Explained
46mKotlin/Native Concurrency Model
44mKotlin/Native Concurrency for Mobile Multiplatform
42mKotlin Multiplatform multithreading old and new way
37mNative Concurrency and Coroutines
28mConcurrency for Imposters
58mKotlin Multiplatform: Memory management old and new way
41mCoroutines for Kotlin Multiplatform in practise
