Bruce Momjian <[EMAIL PROTECTED]> writes:
> Can someone explain why LockMethodCtl is in shared memory while
> LockMethodTable is in postmaster memory context?
> I realize LockMethodCtl has a spinlock, so it has to be in shared
> memory, but couldn't it all be put in shared memory?

I think the original point was not to assume that the shared-memory
pointers would be the same in each backend.  Right now we don't need
that, but I see no good reason to change the data structure.

>     size += MAXALIGN(maxBackends * sizeof(LOCKMETHODCTL));      /* each
>                                                                  * 
>lockMethodTable->ctl */

> Is there one LOCKMETHODCTL for every backend?  I thought there was only
> one of them.

You're right, that line is erroneous; it should read

    size += MAX_LOCK_METHODS * MAXALIGN(sizeof(LOCKMETHODCTL));

Not a significant error but it should be changed for clarity ...

                        regards, tom lane

Reply via email to