According to Java Memory Model, instructions can be reordered as long as the execution is well-formed.
So I wonder, is it possible that the following codes produces the following output?
[codes][in a same thread]
long a = System.currentTimeMillis();
long b = System.currentTimeMillis();
long c = System.currentTimeMillis();
[output]
a == 10, b == 20, c == 15
If not possible, then what does JVM / implementations do to prevent this from happening?