Re: postmaster.pid

"Magnus Hagander" <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.win32
Message-ID <[email protected]>
>I've occasionally thought about abandoning the PID test, in favor of
>relying completely on the shmem-existence test.  If the shmem segment
>named in the lockfile doesn't exist or has zero processes connected to
>it, we could safely assume that the original postmaster is gone.
>(If it has processes connected, we must abort anyway, to cover the case
>where the postmaster crashed but backends remain alive.)  The risk here
>is that we are then *completely* at the mercy of the OS having 
>a correct
>emulation of the SysV shmem semantics, in particular the ability to
>detect whether a shmem segment has other processes connected to it.
>I'm not sure whether this is true on all the supported platforms.
>(This being the win32 list: what about Windows?)

You can try to attach to a segment if it exists. Or create a new one. It
goes away automatically when the last process referring it goes away.
(we're just doing named mmap of the pagefile). Not sure if the shmem
emualation is 100% complete on that, but it sure can be made so.

//Magnus

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.