Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: reading the JLS (17.4.5) Date: Wed, 21 Dec 2011 12:09:41 -0800 Organization: A noiseless patient Spider Lines: 14 Message-ID: References: <17674291.80.1324436881159.JavaMail.geo-discussion-forums@prez5> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 21 Dec 2011 20:09:44 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="XjIWM99mD7Ijfdu600oVPA"; logging-data="8611"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+pWvNi/YCQPeKjKbrInRjTCLlwDGI0SaY=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: Cancel-Lock: sha1:2iLM229X6fuWAHYPHmH1B924fDU= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10936 On 12/21/2011 12:37 AM, Andreas Leitgeb wrote: > *iff* a *volatile* read gets to see the result of a *volatile* > write, then doesn't that say anything about that the write must > have "happened-before" the read? Maybe you know this, but just in case: yes, if a volatile like v1 is written and then read, ALL WRITES before the write of v1 are made visible, including the write of n1 which is not declared volatile. Brian Goetz calls this "piggy-backing," where non-synchronized writes are made visible by piggy-backing on synchronized writes.