Re: Switch to unnamed POSIX semaphores as our preferred sema code? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Switch to unnamed POSIX semaphores as our preferred sema code?
Date
Msg-id 5212.1476118649@sss.pgh.pa.us
Whole thread Raw
In response to Re: Switch to unnamed POSIX semaphores as our preferred sema code?  (Christoph Berg <myon@debian.org>)
Responses Re: Switch to unnamed POSIX semaphores as our preferred sema code?  (Thomas Munro <thomas.munro@enterprisedb.com>)
List pgsql-hackers
Christoph Berg <myon@debian.org> writes:
> 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.

As of HEAD, that should happen automatically for anything using the
"linux" template.


I did some googling (but no actual testing) to try to find out the state
of POSIX sema support for the other platform templates:

aix

AIX doesn't seem to have support (reportedly, the functions exist but
always fail).

cygwin

Not clear whether unnamed semas work on this; I found conflicting reports.

darwin

Unnamed semas are known not to work here.

hpux

Reportedly, unnamed POSIX sema support exists on HPUX 11.x, but on 10.x
sem_init fails with ENOSYS.  We'd need a run-time test in configure to
see whether to use it.  Doubt it's worth the trouble.

netbsd

No support for cross-process unnamed semas.

openbsd

No support for cross-process unnamed semas.

sco

Doubt anyone cares.

solaris

Apparently supported in newer versions of Solaris; as with HPUX,
we might need a run-time configure probe to tell.  Again, without
specific evidence that it might be worth switching, I doubt it's
worth taking any trouble over.

unixware

Doubt anyone cares.

win32

No support.


So at this point it seems likely that stopping with Linux and FreeBSD
is the thing to do, and as far as I can tell the code we have now is
working with all variants of those that we have in the buildfarm.
(I'm a little suspicious that older variants of FreeBSD might not
have working sem_init, like the other *BSD variants, necessitating
a run-time test there.  But we'll cross that bridge when we come
to it.)

So, barring further input, this project is done.  I'll go update
the user docs to explain the new state of affairs.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Re: Hash Indexes
Next
From: Pavel Stehule
Date:
Subject: Re: PL/Python adding support for multi-dimensional arrays