Re: HaveNFreeProcs ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)surnet(dot)cl>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: HaveNFreeProcs ?
Date: 2005-06-23 04:18:38
Message-ID: 631.1119500318@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)surnet(dot)cl> writes:
> I just noticed the HaveNFreeProcs routine is coded as a loop around the
> ProcGlobal struct members. I wonder if it's possible to use a simple
> check in procArray->numBackends against procArray->maxBackends instead?

It used to look like that, but now that numBackends includes prepared
transactions that's no longer a useful test. I think that the existing
coding is OK, because it's written to not loop more than
superuser_reserved_connections times, and it's hard to imagine anyone
would set that to more than half a dozen or so.

Also, that routine will disappear entirely if we agree to remove
commit_siblings (see nearby thread), so right at the moment I'm not very
concerned about improving it. If it is still there forty-eight hours
from now, let's talk about it then.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-06-23 04:21:54 Re: HaveNFreeProcs ?
Previous Message Gavin Sherry 2005-06-23 04:11:58 Re: [PATCHES] O_DIRECT for WAL writes