Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 18 Jan 2012 18:34:52 -0600 Date: Wed, 18 Jan 2012 16:34:50 -0800 From: Patricia Shanahan User-Agent: Mozilla/5.0 (Windows NT 5.2; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Volatile happens before question 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> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Lines: 27 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 75.11.53.36 X-Trace: sv3-0X5/OhoB4BW6WwkF340HGyXg9CiS+kl4UvFB6pu1WdabLQw/OFxyTTEkMoBuHMtm233XhWgW56YRRrF!l0vhG0Ie0tvPixWuLiBgw8BxVE/VIahPeJReQrGR/0U1GmGPxkNKMEvjn04TKwRGk1Z007d/BS+/!oY3XF/J7KzqXV5Zmc+K7ITQiMRGkuepvUn2Npiculwo= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3295 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:11482 On 1/18/2012 4:12 PM, markspace wrote: > On 1/18/2012 3:00 PM, Knute Johnson wrote: >> 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." > > > That's a good find. I can't reconcile that statement with other things > I'm seeing. Since real world hardware seems to be able to produce values > out of thin air, I don't see how Java could prevent this. It seems that > one or the other statement is incorrect. > > I'm curious about the "values out of thin air" statement about hardware. Could you give some information about how it happens? Patricia