Re: Lock structures - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Lock structures
Date
Msg-id 27950.982942199@sss.pgh.pa.us
Whole thread Raw
In response to Lock structures  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Lock structures  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> 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


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: RE: Re: [ADMIN] v7.1b4 bad performance
Next
From: Jaume Teixi
Date:
Subject: hacker mechanism for m$access -> pgsql on different language systems