Kotlin/Native Concurrency Model
summary
Kotlin/Native implements a runtime-level concurrency model that prevents shared mutable state by default, using freeze to mark an object and its reachable graph immutable and throwing on mutation, a local reference-counting collector plus cycle detection, and ownership transfer via worker.execute with safe/unsafe transfer modes. It supplies detached object graph wrappers, arenas and permanent/concurrent containers, atomic primitives, and C/Objective‑C interop via stableRef and pinning. Examples include 4‑core factorization and ping‑pong between main and workers that run correctly under these rules.
AI-written summary · about
chapters (20)
- 0:00Intro
- 1:06WHAT DO WE WANT FROM CONCURRENCY?
- 2:11CONCURRENCY IN KOTLIN
- 3:59SHARED HEAP ON JVM
- 4:32THE CURSE OF SHARED OBJECT HEAP
- 8:15DO WE REALLY NEED OBJECT SHARING?
- 10:01KOTLIN/NATIVE AT LARGE
- 12:37KOTLIN/NATIVE MEMORY MANAGER
- 20:04FREEZING
- 22:51OBJECT GRAPHS CONDENSATION
- 24:49CONCURRENT EXECUTORS - WORKERS
- 26:07OBJECT TRANSFER
- 27:34WORKER.EXECUTE
- 30:14OBJECT PING-PONG EXAMPLE
- 32:41WHY OBJECT GRAPH DETACHMENT?
- 34:17GLOBAL VARIABLES
- 34:57IMPORTANT CASES
- 35:44SHARED CACHE EXAMPLE
- 36:57CONCURRENCY AND INTEROP
- 38:24CONCLUSIONS
related talks
39mKotlin Native Concurrency Explained
39mKotlin Native Concurrency Explained
44mKotlin/Native Concurrency for Mobile Multiplatform
42mKotlin Multiplatform multithreading old and new way
26mKotlin/Native for Multiplatform Development
41mCoroutines for Kotlin Multiplatform in practise
31mKotlin/Native for Multiplatform Development
38mKotlin/Native
