From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Drop support for named POSIX semaphores (the sem_open() kind).
Date: Fri, 13 Nov 2026 23:11:03 +0000
Message-ID: <E1xS0QB-00000000cQZ-2xW2@gemulon.postgresql.org> (raw)
Drop support for named POSIX semaphores (the sem_open() kind).
Commit 72a3902a6 introduced support for sem_open() semaphores
partially as proof of concept of the flexibility of the semaphore API
it introduced, but mostly because that was then the only standardized
semaphore API supported by macOS. However, macOS has had SysV-style
semaphores since 2002, and we long ago switched to preferring those
on that platform.
Named POSIX semaphores are less nice than unnamed or SysV style, first
because they don't work with EXEC_BACKEND, and second because they
typically consume a file descriptor (or some other resource) per
semaphore per backend, i.e. O(N^2) cost for N backends. Hence there
are no platforms where they are the preferred approach, and we might
as well drop our long-untested code to support them.
Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: shihao zhong <zhong950419@gmail.com>
Discussion: https://postgr.es/m/507767.1792981204@sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/70c4a57b64d39c526eb4c44a925eb92a6e56f3c5
Modified Files
--------------
configure | 77 ++-------------------
configure.ac | 22 ++----
doc/src/sgml/runtime.sgml | 6 +-
src/backend/port/meson.build | 2 +-
src/backend/port/posix_sema.c | 157 ++++--------------------------------------
src/include/pg_config.h.in | 3 -
src/template/darwin | 13 ----
7 files changed, 26 insertions(+), 254 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Drop support for named POSIX semaphores (the sem_open() kind).
In-Reply-To: <E1xS0QB-00000000cQZ-2xW2@gemulon.postgresql.org>
References: <E1xS0QB-00000000cQZ-2xW2@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox