Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X1fea-000410-Fl for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Jun 2014 17:46:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X1feZ-0005oS-Pp for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Jun 2014 17:46:07 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X1feW-0005gr-0m for pgsql-hackers@postgresql.org; Mon, 30 Jun 2014 17:46:04 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X1feS-000679-Td for pgsql-hackers@postgresql.org; Mon, 30 Jun 2014 17:46:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s5UHjqZD012904; Mon, 30 Jun 2014 13:45:52 -0400 From: Tom Lane To: Robert Haas cc: Andres Freund , Peter Geoghegan , Pg Hackers , Ants Aasma Subject: Re: better atomics - v0.5 In-reply-to: References: <20140625203635.GJ24114@awork2.anarazel.de> <20140626102006.GB1926@awork2.anarazel.de> <54412.1403808435@sss.pgh.pa.us> <20140626190405.GA21422@awork2.anarazel.de> <20140627180033.GF18288@awork2.anarazel.de> <20140628082559.GB6450@awork2.anarazel.de> <11914.1404147250@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Mon, 30 Jun 2014 13:15:23 -0400" Date: Mon, 30 Jun 2014 13:45:52 -0400 Message-ID: <12903.1404150352@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Robert Haas writes: > I'm personally not convinced that we're approaching this topic in the > right way. I'm not convinced that it's at all reasonable to try to > emulate atomics on platforms that don't have them. I would punt the > problem into the next layer and force things like lwlock.c to have > fallback implementations at that level that don't require atomics, and > remove those fallback implementations if and when we move the > goalposts so that all supported platforms must have working atomics > implementations. People who write code that uses atomics are not > likely to think about how those algorithms will actually perform when > those atomics are merely emulated, and I suspect that means that in > practice platforms that have only emulated atomics are going to > regress significantly vs. the status quo today. I think this is a valid objection, and I for one am not prepared to say that we no longer care about platforms that don't have atomic ops (especially not if it's not a *very small* set of atomic ops). Also, just because a platform claims to have atomic ops doesn't mean that those ops perform well. If there's a kernel trap involved, they don't, at least not for our purposes. We're only going to be bothering with installing atomic-op code in places that are contention bottlenecks for us already, so we are not going to be happy with the results for any atomic-op implementation that's not industrial strength. This is one reason why I'm extremely suspicious of depending on gcc's intrinsics for this; that will not make the issue go away, only make it beyond our power to control. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers