Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bscRs-0003Ad-Q3 for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Oct 2016 21:12:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bscRs-00055Q-Co for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Oct 2016 21:12:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bscRr-00055A-Qk for pgsql-hackers@postgresql.org; Fri, 07 Oct 2016 21:12:55 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bscRk-0007dk-HE for pgsql-hackers@postgresql.org; Fri, 07 Oct 2016 21:12:55 +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 u97LCjhs022265; Fri, 7 Oct 2016 17:12:45 -0400 From: Tom Lane To: Andres Freund cc: pgsql-hackers@postgresql.org Subject: Re: Our "fallback" atomics implementation doesn't actually work In-reply-to: <20161007184007.54cqoed2jwln76wh@alap3.anarazel.de> References: <14947.1475690465@sss.pgh.pa.us> <20161005183402.6veikn2ajr52vosy@alap3.anarazel.de> <24585.1475694129@sss.pgh.pa.us> <20161006024811.fcll3nnfmdn4qtpy@alap3.anarazel.de> <25314.1475726793@sss.pgh.pa.us> <20161007184007.54cqoed2jwln76wh@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Fri, 07 Oct 2016 11:40:07 -0700" Date: Fri, 07 Oct 2016 17:12:45 -0400 Message-ID: <22264.1475874765@sss.pgh.pa.us> X-Pg-Spam-Score: -4.6 (----) 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 Andres Freund writes: > It's not quite there yet, unfortunately. At the moment > pg_atomic_write_u32() is used for local buffers - and we explicitly > don't want that to be locking for temp buffers > (c.f. 6b93fcd149329d4ee7319561b30fc15a573c6307). Hm. > Don't really have a great idea about addressing this, besides either > just living with the lock for temp buffers on fallback platforms (which > don't have much of a practical relevance), or introduce > pg_atomic_unlocked_write_u32() or something. Neither seems great. Maybe we could hack it with some macro magic that would cause pg_atomic_write_u32() to be expanded into a simple assignment in localbuf.c only? 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