A conference talk covering Java 21's concurrency improvements: virtual threads, scope values, and structured concurrency. Virtual threads allow running millions of lightweight threads (1KB vs 1MB for platform threads) without exhausting OS resources, making them ideal for IO-heavy, high-concurrency applications. Scope values replace ThreadLocal for sharing immutable context across virtual threads efficiently. Structured concurrency via StructuredTaskScope provides clean lifecycle management and error handling for grouped async tasks. The talk includes live demos, migration advice using OpenRewrite recipes to identify ThreadLocal candidates for conversion, and best practices like never pooling virtual threads and avoiding them for CPU-intensive work.

47m watch time

Sort: