pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Noah Misch <noah@leadboat.com>
Cc: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL Bugs <pgsql-bugs@postgresql.org>
Subject: Re: Re: [PATCH] Use CC atomic builtins if available [was: Re: TAS patch for building on armel/armhf thumb]
Date: Mon, 19 Dec 2011 15:12:58 -0500
Message-ID: <14852.1324325578@sss.pgh.pa.us> (raw)
In-Reply-To: <20111219200341.GB9495@tornado.leadboat.com>
References: <4EEB1C77.1000309@enterprisedb.com>
	<20111218224203.GA2950@piware.de>
	<CA+TgmoZzgNrWT3af50YL3_zfSN8AtNXK9sOeACti=5ukwiR0vg@mail.gmail.com>
	<4EEF5397.8090200@enterprisedb.com>
	<20111219200341.GB9495@tornado.leadboat.com>

Noah Misch <noah@leadboat.com> writes:
> On Mon, Dec 19, 2011 at 05:09:11PM +0200, Heikki Linnakangas wrote:
>> 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.

How weak is the memory model, exactly?

A correctness problem would ensue if out-of-order stores are possible,
ie other processors could observe the lock being freed (and then acquire
it) before seeing changes to shared variables that had been made while
holding the lock.

I'm a little dubious that this applies to Itanium, because I don't see
any memory fence instruction in the TAS macro.  If we needed one in
S_UNLOCK I'd rather expect there to be one in TAS as well.

			regards, tom lane



view thread (17+ messages)  latest in thread

Message-ID: <14852.1324325578@sss.pgh.pa.us>
Permalink:  ../14852.1324325578@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14852.1324325578@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, noah@leadboat.com, heikki.linnakangas@enterprisedb.com, robertmhaas@gmail.com
  Subject: Re: [PATCH] Use CC atomic builtins if available [was: Re: TAS patch for building on armel/armhf thumb]
  In-Reply-To: <14852.1324325578@sss.pgh.pa.us>
  References: <4EEB1C77.1000309@enterprisedb.com> <20111218224203.GA2950@piware.de> <CA+TgmoZzgNrWT3af50YL3_zfSN8AtNXK9sOeACti=5ukwiR0vg@mail.gmail.com> <4EEF5397.8090200@enterprisedb.com> <20111219200341.GB9495@tornado.leadboat.com> <14852.1324325578@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox