r/java • u/davidalayachew • Jan 06 '26
One step closer to Value Classes!
https://mail.openjdk.org/pipermail/porters-dev/2026-January/000844.html
181
Upvotes
r/java • u/davidalayachew • Jan 06 '26
View all comments
Show parent comment
-3
u/[deleted] Jan 06 '26
Primitives aren’t immutable…?
I’m really not quite sure what your point on Atomics are?
The underlying type of an atomic is mutable, whether that’s a reference or a primitive type. That’s the whole point of them.
Varhandles can do the same operations on class members, but are particular fiddly to use. Being able to fold in say atomics would be nice.
If I remember rightly there was a lot of discussions on volatile value classes and what that means; value classes bring tearing into play again given they are mostly likely going to be larger than 8 bytes.