Re: Thread safety and atomic assignment (again)



Matt Humphrey wrote:

As a clearer example of this point, if the object used for setValue
had non-volatile fields that were not assigned in the constructor,
there is nothing that guarantees that the updated values of those
fields will be visible in a different thread.

Unless, of coujrse, the object itself guarantees that by synchronizing
the getter(s) and setter(s).


.