Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 8117116B0CAE for ; Mon, 19 Dec 2011 16:03:57 -0400 (AST) Received: from mail-qy0-f174.google.com ([209.85.216.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RcjRF-0007tR-3Y for pgsql-bugs@postgresql.org; Mon, 19 Dec 2011 20:03:57 +0000 Received: by qcqz2 with SMTP id z2so3306375qcq.19 for ; Mon, 19 Dec 2011 12:03:44 -0800 (PST) Received: by 10.229.106.210 with SMTP id y18mr6222512qco.89.1324325024547; Mon, 19 Dec 2011 12:03:44 -0800 (PST) Received: from tornado.leadboat.com (ip68-230-222-48.rd.hr.cox.net. [68.230.222.48]) by mx.google.com with ESMTPS id eb5sm42124045qab.10.2011.12.19.12.03.43 (version=SSLv3 cipher=OTHER); Mon, 19 Dec 2011 12:03:44 -0800 (PST) Date: Mon, 19 Dec 2011 15:03:41 -0500 From: Noah Misch To: Heikki Linnakangas Cc: Robert Haas , PostgreSQL Bugs Subject: Re: [PATCH] Use CC atomic builtins if available [was: Re: TAS patch for building on armel/armhf thumb] Message-ID: <20111219200341.GB9495@tornado.leadboat.com> References: <4EEB1C77.1000309@enterprisedb.com> <20111218224203.GA2950@piware.de> <4EEF5397.8090200@enterprisedb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EEF5397.8090200@enterprisedb.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201112/161 X-Sequence-Number: 31972 On Mon, Dec 19, 2011 at 05:09:11PM +0200, Heikki Linnakangas wrote: > Actually, I believe our Itanium (and possibly ARM, too) implementation > of S_UNLOCK() is wrong as it is. There is no platform-specific > S_UNLOCK() defined for Itanium, so we're using the generic > implementation: > > #if !defined(S_UNLOCK) > #define S_UNLOCK(lock) (*((volatile slock_t *) (lock)) = 0) > #endif /* S_UNLOCK */ > > That is not sufficient on platforms with a weak memory model, like Itanium. Other processors may observe the lock as held after its release, but there's no correctness problem.