From: Christoph Berg <myon@debian.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Switch to unnamed POSIX semaphores as our preferred sema code?
Date: Sun, 9 Oct 2016 11:18:03 +0200
Message-ID: <20161009091803.fag2mkehtuknd5s6@msg.df7cb.de> (raw)
In-Reply-To: <29244.1475959928@sss.pgh.pa.us>
References: <8536.1475704230@sss.pgh.pa.us>
<15690.1475761593@sss.pgh.pa.us>
<CA+TgmoZ-3UFcD-qBZevXLiw-_S3zm2xHgSy+Oa7-BCM+7g6_Sw@mail.gmail.com>
<29244.1475959928@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Re: Tom Lane 2016-10-08 <29244.1475959928@sss.pgh.pa.us>
> So I'm still of the opinion that there's not likely to be any meaningful
> performance difference in practice, at least not on reasonably recent
> Linux machines. But this does indicate that if there is any difference,
> it will probably favor switching.
Another data point that's admittedly much more of a footnote than
serious input to the original question is the following: Debian has a
(so far mostly toy) port "hurd-i386" which is using the GNU hurd
kernel along with the usual GNU userland that's also in use on Linux.
This OS doesn't implement any semaphores yet (PG compiles, but initdb
dies with ENOSYS immediately). On talking to the porters, they advised
that POSIX semaphores would have the best chances to get implemented
first, so I added USE_UNNAMED_POSIX_SEMAPHORES=1 to the architecture
template to be prepared for that.
Christoph
(The patch quoted below is obviously Debian-specific and not meant for
inclusion upstream.)
hurd doesn't support sysv semaphores (semget), and needs -pthread to find
sem_init. POSIX semaphores shared between processes (sem_init(pshared = 1))
aren't supported yet either, but have the best chance to get implemented, so be
prepared.
FATAL: could not create semaphores: Function not implemented
DETAIL: Failed system call was semget(1, 17, 03600).
undefined reference to symbol 'sem_init@@GLIBC_2.12'
inline patch 1: src/backend/Makefile, src/template/linux (+11/-0 lines) download inline-1.patch--- a/src/backend/Makefile+++ b/src/backend/Makefile@@ -109,6 +109,10 @@ endif
endif # aix
+ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH_OS), hurd)+LIBS += -pthread+endif # hurd+
# Update the commonly used headers before building the subdirectories
$(SUBDIRS:%=%-recursive): | generated-headers
--- a/src/template/linux+++ b/src/template/linux@@ -28,3 +28,10 @@ if test "$SUN_STUDIO_CC" = "yes" ; then
;;
esac
fi
++# force use of POSIX instead of SysV semaphores on hurd-i386+case $(dpkg-architecture -qDEB_HOST_ARCH) in+ hurd*)+ USE_UNNAMED_POSIX_SEMAPHORES=1+ ;;+esacAttachments:
signature.asc (application/pgp-signature, 800B) download
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-hackers@postgresql.org
Cc: myon@debian.org, tgl@sss.pgh.pa.us, robertmhaas@gmail.com
Subject: Re: Switch to unnamed POSIX semaphores as our preferred sema code?
In-Reply-To: <20161009091803.fag2mkehtuknd5s6@msg.df7cb.de>
References: <8536.1475704230@sss.pgh.pa.us> <15690.1475761593@sss.pgh.pa.us> <CA+TgmoZ-3UFcD-qBZevXLiw-_S3zm2xHgSy+Oa7-BCM+7g6_Sw@mail.gmail.com> <29244.1475959928@sss.pgh.pa.us> <20161009091803.fag2mkehtuknd5s6@msg.df7cb.de>
* 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