~/talk

Coroutines and Loom behind the scenes

Talkat KotlinConf 2023 Day 2 · on Tuesday, 2023-04-25· [kotlin]
slides:none on file

OpenJDK Project Loom (preview since Java 19/20, targeted for Java 21) introduces virtual thread per request that lets a server swap a physical thread for a virtual one with a one-line change (newVirtualThreadPerTaskExecutor) and run 100k sleepy threads instantly — it works and memory drops from GBs to a few KB per fiber. Kotlin Coroutines remain lighter for fine‑grained concurrency (≈600 bytes vs ~2.6KB suspended cost) and Loom has hard limits: native calls and cannot unmount in synchronized sections.

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.