Re: HaveNFreeProcs ? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: HaveNFreeProcs ?
Date
Msg-id 631.1119500318@sss.pgh.pa.us
Whole thread Raw
In response to HaveNFreeProcs ?  (Alvaro Herrera <alvherre@surnet.cl>)
Responses Re: HaveNFreeProcs ?
Re: HaveNFreeProcs ?
List pgsql-hackers
Alvaro Herrera <alvherre@surnet.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


pgsql-hackers by date:

Previous
From: Gavin Sherry
Date:
Subject: Re: [PATCHES] O_DIRECT for WAL writes
Next
From: Tom Lane
Date:
Subject: Re: HaveNFreeProcs ?