Auto optimisation for L cache for object's variables?
问题 Frankly, this is a continue of this my question, inspired by this answer: https://stackoverflow.com/a/53262717/1479414 Let's suppose we have a class: public class Foo { private Integer x; public void setX(Integer x) { this.x = x; } public Integer getX() { return this.x; } } And let us consider a very specific scenario , when we have just two threads which interact with the x variable: At time 1, a thread T1 is created At time 2, T1 sets the value: foo.setX(123); At time 3, a thread T2 is