Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Knute Johnson Newsgroups: comp.lang.java.programmer Subject: Re: Volatile happens before question Date: Wed, 18 Jan 2012 15:00:02 -0800 Organization: A noiseless patient Spider Lines: 16 Message-ID: References: <09848313-2372-4c23-8f52-fa84c612c100@u32g2000yqe.googlegroups.com> <1pi7kea3zdo0b.1ixhuq3p9ybbu$.dlg@40tude.net> <60dddbf9-3686-4824-a918-64a59faba177@a8g2000vba.googlegroups.com> <726da9ce-57f4-4136-b50b-56a032aca196@f1g2000yqi.googlegroups.com> <652cb878-fb2f-4361-8f70-61bc493cebf6@r16g2000yqi.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 18 Jan 2012 23:00:02 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="mz/LDSJwiWnk3Jnnqg7x+Q"; logging-data="29716"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/oOKg2K1GON6ZlqEr3pCtR" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 In-Reply-To: Cancel-Lock: sha1:JVS1HRgdsM2vnPxoVywL6YyWEgI= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:11477 On 1/18/2012 1:16 PM, markspace wrote: > That's what I was thinking. With folks like Brian Goetz and Bartosz > saying the system can simply invent values, it's hard to analyze the > resulting code for any kind of deterministic behavior. Esp. because Java > is a step away from the machine, and I don't know exactly what sort of > operations are going to be executed. I know that the JLS says that variables can have values out of thin air but Goetz says on page 36 "When a thread reads a variable without synchronization, it may see a stale value, but at least it sees a value that was actually placed there by some thread rather then some random value. This safety guarantee is called out-of-thin-air safety." -- Knute Johnson