Re: fork/exec patch - Mailing list pgsql-patches

From Tom Lane
Subject Re: fork/exec patch
Date
Msg-id 18723.1071551464@sss.pgh.pa.us
Whole thread Raw
In response to Re: fork/exec patch  (Neil Conway <neilc@samurai.com>)
Responses Re: fork/exec patch
List pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> Why did you change ShmemIndexLock from an LWLock to a spinlock?

That one I can answer --- it's a bootstrapping issue: we can't use
LWLocks until we have a PGProc (*MyProc), and we can't set that up
without looking in the ShmemIndex for the related data structures.
So ShmemIndex needs to use a more primitive lock type.  This is actually
the way the code used to do it; I changed the lock type when the
opportunity presented itself, but if we're going to support fork/exec
again then we have to go back to how it was done before.

Your other comments seem pretty germane to me, except for

> I wonder whether it is cleaner to make these properly public, rather
> than using the NON_EXEC_STATIC #ifdef... (I'm not necessarily saying
> it is, I'm just tossing it out there).

I don't want to make these things public, because we don't really want
any other modules accessing them.  NON_EXEC_STATIC is pretty ugly,
but it does guarantee that we will soon find out about any unintended
cross-module references, because they won't compile on Unix systems.
If you've got an idea about a cleaner way to do it, I'm all ears ...

            regards, tom lane

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: fork/exec patch
Next
From: Claudio Natoli
Date:
Subject: Re: fork/exec patch