pgsql: Convert PROC_HDR->startupBufferPinWaitBuf to an atomic variable.

From: Nathan Bossart <nathan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Convert PROC_HDR->startupBufferPinWaitBuf to an atomic variable.
Date: 2026-09-22 18:22:28
Message-ID: E1x958O-00000000o1A-2dJj@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Convert PROC_HDR->startupBufferPinWaitBuf to an atomic variable.

Currently, this variable is a Buffer that is accessed via a
volatile pointer. By converting it to an atomic variable, we can
remove the volatile qualifiers. No barriers are needed because the
value is published before the backends that read it are signaled.

Reviewed-by: Peter Eisentraut <peter(at)eisentraut(dot)org>
Reviewed-by: Andres Freund <andres(at)anarazel(dot)de>
Reviewed-by: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Tested-by: solai v <solai(dot)cdac(at)gmail(dot)com>
Discussion: https://postgr.es/m/alAJeRRzehDjLaF1%40nathan

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cb4a03db9ed7606da1c36e4214a6c5fd6437a26c

Modified Files
--------------
src/backend/storage/lmgr/proc.c | 12 +++---------
src/include/storage/proc.h | 2 +-
2 files changed, 4 insertions(+), 10 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Nathan Bossart 2026-09-22 18:51:19 pgsql: Convert Sharedsort's worker counters to atomic variables.
Previous Message Peter Eisentraut 2026-09-22 18:02:23 pgsql: Silence warnings about unused global variables