From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpCYk-0007px-FC for qemu-devel@nongnu.org; Wed, 19 Jun 2013 03:12:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UpCYh-00078h-JQ for qemu-devel@nongnu.org; Wed, 19 Jun 2013 03:12:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpCYh-00078Z-9t for qemu-devel@nongnu.org; Wed, 19 Jun 2013 03:11:59 -0400 From: Torvald Riegel In-Reply-To: <20130619015307.GY5146@linux.vnet.ibm.com> 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> <20130618145033.GN5146@linux.vnet.ibm.com> <1371569862.16968.23402.camel@triegel.csb> <20130619015307.GY5146@linux.vnet.ibm.com> Content-Type: text/plain; charset="UTF-8" Date: Wed, 19 Jun 2013 09:11:36 +0200 Message-ID: <1371625896.16968.24243.camel@triegel.csb> Mime-Version: 1.0 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: paulmck@linux.vnet.ibm.com Cc: Susmit.Sarkar@cl.cam.ac.uk, Andrew Haley , qemu-devel@nongnu.org, Liu Ping Fan , Anthony Liguori , luc.maranget@inria.fr, Paolo Bonzini , Peter.Sewell@cl.cam.ac.uk, Richard Henderson On Tue, 2013-06-18 at 18:53 -0700, Paul E. McKenney wrote: > On Tue, Jun 18, 2013 at 05:37:42PM +0200, Torvald Riegel wrote: > > On Tue, 2013-06-18 at 07:50 -0700, Paul E. McKenney wrote: > > > First, I am not a fan of SC, mostly because there don't seem to be many > > > (any?) production-quality algorithms that need SC. But if you really > > > want to take a parallel-programming trip back to the 1980s, let's go! ;-) > > > > Dekker-style mutual exclusion is useful for things like read-mostly > > multiple-reader single-writer locks, or similar "asymmetric" cases of > > synchronization. SC fences are needed for this. > > They definitely need Power hwsync rather than lwsync, but they need > fewer fences than would be emitted by slavishly following either of the > SC recipes for Power. (Another example needing store-to-load ordering > is hazard pointers.) The C++11 seq-cst fence expands to hwsync; combined with a relaxed store / load, that should be minimal. Or are you saying that on Power, there is a weaker HW barrier available that still constrains store-load reordering sufficiently? Torvald