Proposed Java API would enable sharing of immutable data across threads
Java could gain a capability for sharing immutable data across threads, based on a plan now under consideration in the OpenJDK realm.
An OpenJDK proposal for extent-local variables, currently an incubating API, would provide a programming model to share data both within a thread and with child threads. Extent-local variables are preferred to thread-local variables, particularly when using large numbers of virtual threads, the proposal states.
The proposal lists four goals behind the incubating API: