New candidate JEP: 464: Scoped Values (Second Preview)
Eric Kolotyluk
eric at kolotyluk.net
Wed Nov 29 21:18:15 UTC 2023
Wow, great introduction. I never really grokked Thread Local Variables
before, but now it makes much more sense with this explanation. And, I
can easily see why Scoped Values are better in most cases.
As an aside, someone noted, I forget where, that Scoped Values are a
little like 'implicits' in Scala, now 'given' and 'using.' I have never
really liked implicit in Scala, mostly because it was abused so
frequently, but this JEP better explains the use case.
Thanks.
On 2023-11-29 7:18 a.m., Mark Reinhold wrote:
> https://openjdk.org/jeps/464
>
> Summary: Introduce scoped values, which enable the safe and efficient
> sharing of immutable data within and across threads. They are preferred
> to thread-local variables, especially when using large numbers of
> virtual threads. This is a preview API.
>
> - Mark
More information about the loom-dev
mailing list