pgsql: Require memory barrier support.

From: Thomas Munro <tmunro(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Require memory barrier support.
Date: 2024-07-30 11:03:37
Message-ID: E1sYkdl-001sbu-ID@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Require memory barrier support.

Previously we had a fallback implementation that made a harmless system
call, based on the assumption that system calls must contain a memory
barrier. That shouldn't be reached on any current system, and it seems
highly likely that we can easily find out how to request explicit memory
barriers, if we've already had to find out how to do atomics on a
hypothetical new system.

Removed comments and a function name referred to a spinlock used for
fallback memory barriers, but that changed in 1b468a13, which left some
misleading words behind in a few places.

Reviewed-by: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Suggested-by: Andres Freund <andres(at)anarazel(dot)de>
Discussion: https://postgr.es/m/721bf39a-ed8a-44b0-8b8e-be3bd81db748%40technowledgy.de
Discussion: https://postgr.es/m/3351991.1697728588%40sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/83aadbeb96f019fff88e6a06615fe0a86c6956ca

Modified Files
--------------
src/backend/port/atomics.c | 23 -----------------------
src/include/port/atomics.h | 4 ++++
src/include/port/atomics/fallback.h | 16 ----------------
src/include/port/atomics/generic.h | 10 ----------
4 files changed, 4 insertions(+), 49 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2024-07-30 11:09:42 Re: pgsql: Remove --disable-spinlocks.
Previous Message Peter Eisentraut 2024-07-30 10:34:47 pgsql: pg_createsubscriber: Remove obsolete comment