[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
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,
[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.
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
[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)
> +{
> +/
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