Hacker News new | ask | show | jobs
by wgren 5416 days ago
>if [a JVM thread] reads a field of an object, and another thread writes to the same field of the same object, then the program will see either the old value, or the new value, but not something else entirely

Nitpick: unless the field in questions is a "long" or "double". In those cases the operation becomes two bytecodes and you can in fact see something else entirely if you are unlucky. At least it used to be like that.

1 comments

On 32-bit platforms.

On 64-bit, you won't. =)