Why it matters

Loom is Java's biggest concurrency shift in decades. Understanding shapes future patterns.

Advertisement

The architecture

Virtual threads (delivered Java 21): shipped feature.

Structured concurrency (preview): scope-based task management.

Loom featuresVirtual threadsJava 21 stableStructured concurrencypreviewScoped valuespreviewStructured concurrency: tasks that outlive scope automatically cancelled — safer than raw threads
Loom deliverables.
Advertisement

How it works end to end

Structured concurrency: 'try (var scope = new StructuredTaskScope.ShutdownOnFailure()) { ... }' ensures tasks complete or all cancel together.

Scoped values: alternative to ThreadLocal that works better with virtual threads.