From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Up7aF-0002aZ-Fk for qemu-devel@nongnu.org; Tue, 18 Jun 2013 21:53:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Up7aC-000883-La for qemu-devel@nongnu.org; Tue, 18 Jun 2013 21:53:15 -0400 Received: from e32.co.us.ibm.com ([32.97.110.150]:50335) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Up7aC-00085V-Ea for qemu-devel@nongnu.org; Tue, 18 Jun 2013 21:53:12 -0400 Received: from /spool/local by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 18 Jun 2013 19:53:11 -0600 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 3F1333E40040 for ; Tue, 18 Jun 2013 19:52:50 -0600 (MDT) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r5J1r8PA147940 for ; Tue, 18 Jun 2013 19:53:08 -0600 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r5J1tXlx009249 for ; Tue, 18 Jun 2013 19:55:34 -0600 Date: Tue, 18 Jun 2013 18:53:07 -0700 From: "Paul E. McKenney" Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1371569862.16968.23402.camel@triegel.csb> Subject: Re: [Qemu-devel] Java volatile vs. C11 seq_cst (was Re: [PATCH v2 1/2] add a header file for atomic operations) Reply-To: paulmck@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Torvald Riegel 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, 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.) > > PS: Nevertheless, I personally prefer the C++ formulation, but that is > > only because I stand with one foot in theory and the other in > > practice. If I were a pure practitioner, I would probably strongly > > prefer the Java formulation. > > That's because you're a practitioner with experience :) I knew I had all this grey hair for some reason or another... ;-) Thanx, Paul