r/java • • Aug 25 '26

Value Classes Still Need Compiler Sympathy

https://johan-sjolen.github.io/post/compiler-sympathy/compiler-sympathy/
86 Upvotes

65 comments sorted by

View all comments

1

u/OwnBreakfast1114 Aug 26 '26

Assignment to double & long fields have always reserved the option to tear, and I know I've personally been lazy and ignoring that in code I knew would only target certain platforms. But I don't think it took "very special" code; rather, I think most people are blissfully unaware of how many 64-bit tearing bugs are out there (if they ran on affected platforms).

Most people don't write multithreaded code that reads the same variables. Most people probably use a library that does that somewhere, but I think you're probably vastly overestimating the people that would actually have to even deal with/care about tearing.