Skip site navigation (1) Skip section navigation (2)

Re: darwin pgsql patches

From: Ian Lance Taylor <ian(at)airs(dot)com>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: bierman(at)apple(dot)com, pgsql-patches(at)postgresql(dot)org
Subject: Re: darwin pgsql patches
Date: 2000-12-05 17:22:25
Message-ID: 20001205172225.8329.qmail@daffy.airs.com (view raw or flat)
Thread:
Lists: pgsql-patches
   Date: Tue, 05 Dec 2000 10:58:15 -0500
   From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>

   Peter Bierman <bierman(at)apple(dot)com> writes:
   >> POSIX IPC isn't compatible with SysV IPC?  News to me.  Chapter and
   >> verse, please?

   > Didn't say that. They're just two different APIs for doing semaphores.

   I'm still startled.  Why would the POSIX guys have invented their own
   API, rather than standardizing on the well-entrenched SysV IPC calls?
   They did not have a charter to invent new stuff.

The POSIX semaphore interface comes from the pthreads work.  In my
opinion, the System V IPC calls are badly designed.  I haven't done
much work with POSIX semaphores, but they are simpler and more
efficient to implement.

   > Since PG uses it's own shim to go from internal functions to the SysV
   > API, I'm asking if there'd be objection to me implementing the
   > conditional code in src/backend/storage/ipc.c, having PG's shim use
   > POSIX API directly.

   No objection here, but I wonder whether you'll find that it helps.
   The ipc.c code is so thin that it doesn't really hide any SysV
   semantics.  In particular, it will not help you to hack ipc.c if your
   problem is that child processes don't inherit access to semaphores
   created by their parent.  (But that would be so impossibly brain-dead
   that I do not believe it...)

Believe it.  Having semaphores be shared between processes is optional
when using POSIX semaphores.  GNU/Linux, at least with glibc 2.1, does
not implement sharing semaphores between processes.

However, on systems which do fully implement POSIX semaphores, it
should be easy for Postgres to use them.  They should be created in
the shared memory segment.

Ian

In response to

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2000-12-05 17:28:59
Subject: Re: darwin pgsql patches
Previous:From: Peter EisentrautDate: 2000-12-05 16:23:55
Subject: Re: darwin pgsql patches

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group