Re: LWLock/ShmemIndex startup question - Mailing list pgsql-hackers

From Tom Lane
Subject Re: LWLock/ShmemIndex startup question
Date
Msg-id 28336.1073918535@sss.pgh.pa.us
Whole thread Raw
In response to LWLock/ShmemIndex startup question  (Claudio Natoli <claudio.natoli@memetrics.com>)
List pgsql-hackers
Claudio Natoli <claudio.natoli@memetrics.com> writes:
> Are these comments still true? Specifically, is it necessary to call
> CreateLWLocks before InitShmemIndex? I think it used to be, but then the
> ShmemIndexLock got made into a separate spinlock in its own right.

I think the only dependency was that ShmemIndexLock was an LWLock.

> It doesn't appear to be true, and I'd like to rearrange this section of the
> code,

You have broken stuff before by rearranging the sequence of
operations... what exactly have you got in mind here?

> ... a possible solution to a Win32 shmem/semaphore bootstrap
> problem (postgres semaphores under Win32 uses ShmemIndex which uses
> spinlocks which use shared memory which use semaphores which ...).

The correct solution to that seems to lie elsewhere, ie, not use
semaphores for spinlocks.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Treat
Date:
Subject: Re: OLE DB driver
Next
From: "Thomas Hallgren"
Date:
Subject: Request for additional SPI functions.