Sailing Modern Java
summary
Java 21 adds concrete features: virtual threads let a demo create one million lightweight threads for IO-bound workloads, but they don’t speed CPU-bound code and must not be pinned (use -XX:TracePinThreads or JFR to find pins). Structured concurrency and scope values simplify cancellation and thread-local reasoning. Project Panama’s foreign memory API and vector API expose fast native access. Generational ZGC drops GC pause from ~1133 ms (G1 example) to ~30 µs; use -XX:+UseZGC -XX:+ZGenerational.
AI-written summary · about
chapters (24)
- 0:00Welcome to modern Java
- 1:33Speaker background
- 4:46LTS vs latest Java versions
- 8:16Preview features in Java
- 9:00Project Loom: Virtual threads
- 11:07How virtual threads work
- 13:56When to use virtual threads
- 17:21Virtual threads performance
- 18:45Pitfalls with virtual threads
- 20:53Fixing thread pinning
- 23:00Structured concurrency
- 26:10Cancellation in tasks
- 28:19Scope values replacing thread locals
- 32:54Pattern matching and records
- 38:11Record patterns and variables
- 40:17Project Panama: Foreign memory API
- 43:06Vector API for performance
- 46:40Generational ZGC
- 50:59Sequence collections
- 52:43String templates
- 55:10Unnamed classes and scripting
- 57:17Java 21 security
- 58:41Workshops and learning
- 59:03Q&A








