A conference talk by José Paumard (Oracle Java Developer Advocate) covering Java's Structured Concurrency API, still a preview feature in JDK 25/26. The talk explains why traditional ExecutorService patterns are problematic (poor stack traces, thread leaks, security gaps with ThreadLocals), and how Project Loom's StructuredTaskScope fixes these issues. Key concepts covered include: creating a StructuredTaskScope via the open() factory method, forking tasks that run on virtual threads, calling join() before retrieving results, and using the Joiner interface to customize behavior on task completion, failure, and timeout. The talk also explains how ScopeValues integrate with structured concurrency to safely share bindings across virtual threads without escape risks. Practical warnings are given about race conditions in the onComplete callback and the importance of not using virtual threads for CPU-bound work.

48m watch time

Sort: