Re: Lock structures
| От | Tom Lane |
|---|---|
| Тема | Re: Lock structures |
| Дата | |
| Msg-id | 27950.982942199@sss.pgh.pa.us обсуждение |
| Ответ на | Lock structures (Bruce Momjian <pgman@candle.pha.pa.us>) |
| Ответы |
Re: Lock structures
|
| Список | 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 по дате отправления: