Addressing the full range of use cases
Brian Goetz
brian.goetz at oracle.com
Tue Oct 5 15:00:00 UTC 2021
JVM support for atomicity guarantees seems more difficult—algorithms for ensuring atomicity above 64 bits tend to be prohibitively expensive. The current prototype simply gives up on flattening when atomicity is requested; not clear whether
Note that this only gives up on flattening *in the heap*; flattening on the stack (calling convention optimization) and scalarization are still in play.
Alternatively, can we train programmers to treat out-of-sync values with the same tolerance they give to out-of-sync object state in classes that aren't thread safe?
Note that to produce tearing, you have to have a data race (i.e., broken program), where there is a read-write or write-write race on a reference to a primitive class.
More information about the valhalla-spec-observers
mailing list