On Thu, Jun 7, 2012 at 3:26 AM, Martin Strand < [email protected]> wrote:
> On Thu, 07 Jun 2012 02:24:35 +0200, Cezary Biernacki <[email protected]> > wrote: > > "* The semantics of volatile variables have been strengthened to have >> acquire and release semantics. In the original speciļ¬cation, accesses to >> volatile and non-volatile variables could be >> freely ordered. >> > > Aha, so does this mean that "volatile" introduces the same memory > semantics that a read lock does? > Yes (assuming that I understand JSR-133 ;-). > If message is declared volatile, even its non-final fields would be > guaranteed to be published properly? > Yes > But if it's not volatile we have the usual problem with uninitialized > fields? Yes, for non-final fields. Cezary
