jvm memory model:
The principle of first occurrence happens-----before
Instruction reordering:
We write such a piece of code, how many possible results can we guess?
There are several possibilities.
In order to output all kinds of situations, we use an infinite loop to run this code:
So why does it happen that x and y are both 0?
Because it may have produced this instruction rearrangement.