Skip site navigation (1) Skip section navigation (2)

Re: myProcLocks initialization

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: myProcLocks initialization
Date: 2011-10-31 03:13:51
Message-ID: 2719.1320030831@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> I'd like to propose the attached patch, which initializes each
> PGPROC's myProcLocks just once at postmaster startup, rather than
> every time the PGPROC is handed out to a backend.  These lists should
> always be emptied before a backend shuts down, so a newly initialized
> backend will find the lists empty anyway.  Not reinitializing them
> shaves a few cycles.  In my testing, it saves about 1% of the cost of
> setting up and tearing down a connection, which is not a ton, but a
> cycle saved is a cycle earned.

That's not really enough to excite me, and the prospect of problems in
one session corrupting an unrelated later one is pretty scary from a
debugging standpoint.  How about at least an Assert that the lock is in
a clean state?

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2011-10-31 03:26:08
Subject: Re: myProcLocks initialization
Previous:From: Christopher BrowneDate: 2011-10-31 02:00:23
Subject: Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group