Re: Lock structures

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Lock structures
Date: 2001-02-23 15:29:59
Message-ID: 27950.982942199@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-02-23 15:41:34 Re: AW: ask for help !!! (emergency case)
Previous Message Hannu Krosing 2001-02-23 15:00:21 Re: RE: Re: [ADMIN] v7.1b4 bad performance