Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wmWey-000peP-0C for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Jul 2026 13:06:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wmWex-00CB0a-1Y for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Jul 2026 13:06:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wmWex-00CB0S-05 for pgsql-hackers@lists.postgresql.org; Wed, 22 Jul 2026 13:06:50 +0000 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wmWeu-00000001QBn-15w2 for pgsql-hackers@postgresql.org; Wed, 22 Jul 2026 13:06:49 +0000 Received: by mail-qt1-x82b.google.com with SMTP id d75a77b69052e-51c1372f84dso87825831cf.2 for ; Wed, 22 Jul 2026 06:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784725607; x=1785330407; darn=postgresql.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=tgRog4Ur8mn3c6Djpr3oIdd9pDNlqi+1qivqvB6llQo=; b=KdAmiHqEzzFKk6zuRjgJSSbINm5m2uEFVwJOLD6T/0vKdIV4M16kj7WboDSttjrGmG N6QDuWkiuSQ6vtxY0O2Pl6+5SrXQRpx57EkKsyTNgGBarzWlQtTfvnL8pWCbeD5jWm34 cgwnqyQzVd+RvqUCBIaRHodh5YVUwMimQj9zVcu0+9Me4hNfSE2gxWspLrB/S0CwUdo/ X33DD3I40QAI4TVIgcF6ZjMJZH4rbIQHWTV2aWNJ9foa0hi+gX6VA31B9Fnjctl/E5VD 50wbJCS+672NHTEqo8N/zztJGvKZScBOaNOho3+D+fcpbS29eSnEup6g3zkzqq9aDYo9 yezg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784725607; x=1785330407; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=tgRog4Ur8mn3c6Djpr3oIdd9pDNlqi+1qivqvB6llQo=; b=q5pDJlC4leQ1iqi4uxdZU+qU1TGDSfgGsNfHONaZDT2nfood6EvWSj8TmDvL5gkjTJ pJYisiz1Y6RTtU+yXB+yGwTq6vOW50RgXf7vw3Y5Sw7smO/9EKCHAXe6ePJmuOvyjc0G lKA1dD5Ay7RFWIsJHIpCtIAqZFIDUl/OuMM2PWxVmxi59r5z/A6yTL4vAsY7D1jnI5RM pLTob/PxQQLTyD1Q9N2Saf0fo8OkZBywAgM3bp1JvyXbCVDjwF8TE1ifI0j6iUPSW79M BfdR4TBlmwlDJU5NNra1L9upEsujY/IEBaYs7Acbk+nhSUxYJr5fgZ56RDfQUOjLznqt ur8Q== X-Gm-Message-State: AOJu0Yy8tcae5bnBHUcrb0gEU2N4/CSB7ySC+CWJW76AF5Sy+ygUHNOW rxXTrevDR1lQuVi30qPnj0pRA5FP2ziIX0jkFZSoJqqZJgRECogXJAQ4 X-Gm-Gg: AR+sD11ICABUOz2E9ZDTB1DEB39gIJFci2hVuIiGPYXE98pwBtM5ORVbGo4tmKBG7z+ Dam7jbI/mU7/NbHcT+hbnK0lnrErTEVrlwTt1Tp5vcS3DK54E2dq4pUzDABNe9A7vNeX7WRK5dT q5t7hS2eEQWgp30AQAWVuy7MF1aAhDaOVkQPSdx8lDQM5omREB/Gk2wPN0gV13Uvs65btM8GC7R GYZ8l0iEituuk0n/35d1zk1Uu0TKHBEqNHwiKr6DrOsSP0tKaHK9NA62P8sKtgdgj+lpf55kYdq ydrlG5XpcnW/ArViE5ckgEOlmgg6UugvxGTZHA9d+HK8EQ59ZDl0NQ0dQx/1TtHxqNeAmpnSMgt f17aREDT7CHkWhMSDxMlmMJFy4DNiHs9cGPtR4ZdXqyDxdqkMg63CCNmZS/fCoz1apiL3ghoTLy SnOqp4DqEefNfw6SLGm0LIXuw63a2sCs+j1I2RjuO08omd X-Received: by 2002:a05:622a:4d43:b0:51c:478:3299 with SMTP id d75a77b69052e-5213aa6cc4amr216778271cf.9.1784725606677; Wed, 22 Jul 2026 06:06:46 -0700 (PDT) Received: from nathan ([2600:382:b606:ca0:611e:1c00:d8ac:92cf]) by smtp.gmail.com with ESMTPSA id af79cd13be357-930f68d323asm160743385a.19.2026.07.22.06.06.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2026 06:06:46 -0700 (PDT) Date: Wed, 22 Jul 2026 09:06:44 -0400 From: Nathan Bossart To: Peter Eisentraut Cc: pgsql-hackers@postgresql.org Subject: Re: convert various variables to atomics Message-ID: References: <9d8c317d-d933-46c7-b675-4b9308eaca2b@eisentraut.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9d8c317d-d933-46c7-b675-4b9308eaca2b@eisentraut.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jul 22, 2026 at 02:31:49PM +0200, Peter Eisentraut wrote: > Here is an instance that seems obviously wrong: > > /* Buffer id of the buffer that Startup process waits for pin on, or -1 */ > - int startupBufferPinWaitBufId; > + pg_atomic_uint32 startupBufferPinWaitBufId; I may just be undercaffeinated, but what is wrong with this case? AFAICT the casting should work as expected, and I see other examples that do something similar, like avLauncherProc. -- nathan