~/talk

Kotlin Coroutine Mechanisms

Talkat droidcon New York 2025 · 2025-06-25..06-26· [kotlin]
slides:none on file

Coroutines are cheaper than threads: multiple coroutines run on one thread, suspend and resume across threads, and avoid heavy context switches; a thread-pool example shows wrong balances and ordering when mutable state is shared. Follow structured concurrency: parent waits for children and child never gets lost — use proper CoroutineScope/CoroutineContext, prefer supervisorScope/supervisorJob to isolate failures, use withContext(NonCancellable) for cleanup, and enable the kotlinx-coroutines-debug probe or IDE coroutine debugger to trace live coroutines.

AI-written summary · about

  1. 0:00Introduction
  2. 1:04Talk overview
  3. 3:53Developer journey with Kotlin coroutines
  4. 4:36Problems solved by coroutines
  5. 8:53Why threads are hard
  6. 9:58Thread cooperation and side effects
  7. 14:36Structured concurrency
  8. 18:32Parent waits for children
  9. 19:14Coroutine scope vs context
  10. 23:50Job vs scope hierarchy
  11. 25:33Debugging in IntelliJ IDEA
  12. 28:01Breaking structured concurrency
  13. 29:06Respecting structured concurrency
  14. 30:51Cancellation and timeout
  15. 32:12Unhandled exceptions
  16. 33:59Exception handling strategies
  17. 35:23Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.