From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpKR0-0003gl-5w for qemu-devel@nongnu.org; Wed, 19 Jun 2013 11:36:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UpKQy-0003lI-C6 for qemu-devel@nongnu.org; Wed, 19 Jun 2013 11:36:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpKQy-0003lA-4Q for qemu-devel@nongnu.org; Wed, 19 Jun 2013 11:36:32 -0400 Message-ID: <51C1CFF8.7060200@redhat.com> Date: Wed, 19 Jun 2013 16:36:24 +0100 From: Andrew Haley MIME-Version: 1.0 References: <1371381681-14252-1-git-send-email-pingfanl@linux.vnet.ibm.com> <1371381681-14252-2-git-send-email-pingfanl@linux.vnet.ibm.com> <51BF5C0F.6020209@twiddle.net> <51C05F88.2090308@redhat.com> <51C09B29.70400@redhat.com> <51C17A3D.40108@redhat.com> In-Reply-To: <51C17A3D.40108@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Java volatile vs. C11 seq_cst (was Re: [PATCH v2 1/2] add a header file for atomic operations) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Torvald Riegel , qemu-devel@nongnu.org, Liu Ping Fan , Anthony Liguori , "Paul E. McKenney" , Richard Henderson On 06/19/2013 10:30 AM, Paolo Bonzini wrote: > Il 18/06/2013 19:38, Andrew Haley ha scritto: >>>> Or is Java volatile somewhere between acq_rel and seq_cst, as the last >>>> paragraph of >>>> http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html#volatile >>>> seems to suggest? >> As far as I know, the Java semantics are acq/rel. I can't see anything >> there that suggests otherwise. If we'd wanted to know for certain we >> should have CC'd Doug lea. > > acq/rel wouldn't have a full store-load barrier between a volatile store > and a volatile load. Ahhh, okay. I had to check the C++11 spec to see the difference. I'm so deep into the Java world that I hadn't noticed that C++11 was any different. Andrew.