Scoped values are introduced to enable methods to share immutable data across threads in Java efficiently. They are easier to reason about than thread-local variables and have lower space and time costs, especially with virtual threads and structured concurrency. The scoped values API, proposed for re-preview in JDK 24, aims to

22m read timeFrom inside.java
Post cover image
Table of contents
SummaryHistoryGoalsNon-GoalsMotivationDescriptionAlternatives

Sort: