Scoped values enable a method to share immutable data both with its callees within a thread and with child threads in a convenient, safe, scalable way, particular in comparison to thread-local variables. They are a preview feature in Java 24.
JEP 487 - Scoped Values: https://openjdk.org/jeps/487
JDK 24: https://jdk.java.net/24/
✨ Don't miss JavaOne: https://dev.java/community/javaone-2025/ ✨
~~~ Chapters ~~~
0:00 Intro
0:16 Passing Data
1:27 Scoped Values
2:36 Immutability and Nesting
3:23 Threading and Inheritance
4:34 vs ThreadLocal
7:04 Finalization
Tags: #Java #Java24 #OpenJDK #Performance