Re: [PATCHES] Nameless IPC on POSIX systems

2005-05-06 Thread Tom Lane
[EMAIL PROTECTED] (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) writes: > Tom Lane <[EMAIL PROTECTED]> writes: >> The check we need is "are there any other processes (still) attached to >> this shmem" and AFAIK that is not available in the mmap API. Do you >> know how to get it? > You can hack somethi

Re: [PATCHES] Nameless IPC on POSIX systems

2005-05-06 Thread Dag-Erling Smørgrav
Tom Lane <[EMAIL PROTECTED]> writes: > The check we need is "are there any other processes (still) attached to > this shmem" and AFAIK that is not available in the mmap API. Do you > know how to get it? You can hack something up with fcntl() locks. If a process has a shared lock on the shm file,

Re: [PATCHES] Nameless IPC on POSIX systems

2005-05-06 Thread Tom Lane
[EMAIL PROTECTED] (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) writes: > You can use file-backed shared memory instead. You need a directory > which you know is writeable and unique to this instance, on a file > system with enough free space to accomodate the full size of the > shared memory segment.

Re: [PATCHES] Nameless IPC on POSIX systems

2005-05-06 Thread Dag-Erling Smørgrav
Tom Lane <[EMAIL PROTECTED]> writes: > This is not acceptable in the slightest, because it offers no protection > against the situation where the old postmaster has crashed but there are > still live backends. If a new postmaster and new backends are allowed > to start in that situation, using a n

Re: [PATCHES] Nameless IPC on POSIX systems

2005-05-06 Thread Tom Lane
[EMAIL PROTECTED] (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) writes: > The attached patch implements new semaphore and shared memory > mechanisms for POSIX systems. I'm afraid we'll have to reject this out of hand: > +bool > +PGSharedMemoryIsInUse(unsigned long id1, unsigned long id2) > +{ > +/

[PATCHES] Nameless IPC on POSIX systems

2005-05-06 Thread Dag-Erling Smørgrav
The attached patch implements new semaphore and shared memory mechanisms for POSIX systems. Semaphores are implemented using unnamed pipes. A semaphore is incremented by writing a single character to the pipe, and decremented by reading a single character. The only semaphore operation we can't r