~/talk

Coroutines and Loom behind the scenes

Talkat KotlinConf 2023 · 2023-04-12..04-14· [kotlin]
slides:none on file

A live demo runs 100,000 threads sleeping: physical threads take tens of seconds and lots of OS resources, virtual threads start immediately. Project Loom uses new virtual thread per task executor and copies stacks to the heap on yield, cutting per-thread memory to roughly ~2.6KB allocations and ~14KB heap in one preview measurement; Kotlin Coroutines show ~600B allocs and ~360B heap when suspended. Loom pins threads inside native or synchronized code, tooling is preview-level, and coroutines keep structured concurrency and fine-grained async control.

AI-written summary · about

  1. 0:00Coroutines and Project Loom intro
  2. 1:06Loom goals and features
  3. 3:13Demo: physical vs virtual threads
  4. 5:20Virtual threads for servers
  5. 6:47Legacy code thread issues
  6. 9:58Adopt virtual threads easily
  7. 11:01Debugging virtual threads
  8. 12:52Virtual threads save resources
  9. 15:21Loom limitations
  10. 17:10Kotlin coroutines intro
  11. 18:37Loom vs coroutines goals
  12. 20:43Loom vs coroutines style
  13. 22:06Event handling and concurrency
  14. 24:13Kotlin structured concurrency
  15. 26:02Why structured concurrency matters
  16. 28:07Loom vs coroutines implementation
  17. 31:18Memory usage: threads vs coroutines
  18. 34:48CPU performance challenges
  19. 35:51IO performance and libraries
  20. 37:37Tooling for threads and coroutines
  21. 39:47Best of Loom and coroutines
  22. 42:12Trade-offs with both
  23. 44:23Summary
~/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.