Re: Native Windows, Apache Portable Runtime - Mailing list pgsql-hackers

From Cyril VELTER
Subject Re: Native Windows, Apache Portable Runtime
Date
Msg-id 011a01c1f526$bafade50$6901a8c0@cvfixe
Whole thread Raw
In response to Native Windows, Apache Portable Runtime  (mlw <markw@mohawksoft.com>)
List pgsql-hackers
> Well, SharedMemoryIsInUse is *not* just about ensuring that the shared
> memory gets reaped.  The point is to ensure that you can't start a new
> postmaster until the last old backend is gone.  (Consider situations
> where the parent postmaster process crashes, or perhaps is kill -9'd
> by a careless DBA, but there are still active backends.  We want to
> detect that situation and ensure that a new postmaster will refuse to
> start.)
   Yes I remember that now (the current code do that correctly).

>
> >> How so?  If those calls were needed before, why won't all three still
> >> be needed?
>
> >     In the current hack, I've to iterate over all sharedmem segments
(system
> > wide) to find the original one by name. There is a race condition here
if
> > several backend are starting at the same time.
beos_before_backend_startup
> > beos_backend_startup_failed acquire / release a semaphore which prevent
> > several fork at the same time.
>
> Does keeping the shmem segment name around solve that?  Seems like you
> don't need a PGShmemHeader field for that; just store it in a static
> variable.

No the name is not enough, I need the beos handle for each shared mem
segment. I'll try to find a cleaner solution using existing API.

           cyril



pgsql-hackers by date:

Previous
From: Ryan Bradetich
Date:
Subject: a couple of minor itches: RI Trigger Names, and additional Alter ownerships commands.
Next
From: Jan Wieck
Date:
Subject: Re: HEADS UP: Win32/OS2/BeOS native ports