Lock structures

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Lock structures
Date: 2001-02-23 06:38:39
Message-ID: 200102230638.BAA16133@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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?

Also, the code:

LockShmemSize(int maxBackends)
{
int size = 0;

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

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

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sezai YILMAZ 2001-02-23 07:30:55 Re: Turkish locale bug
Previous Message Rod Taylor 2001-02-23 04:48:15 Permissions on SERIAL