Re: Why are these ARC variables per-backend? - Mailing list pgsql-hackers

From Kenneth Marshall
Subject Re: Why are these ARC variables per-backend?
Date
Msg-id 20040419194745.GB22001@it.is.rice.edu
Whole thread Raw
In response to Re: Why are these ARC variables per-backend?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Apr 19, 2004 at 02:58:11PM -0400, Tom Lane wrote:
> Jan Wieck <JanWieck@Yahoo.com> writes:
> > Tom Lane wrote:
> >> I've got a problem with these variables in freelist.c:
> >> 
> >> static int        strategy_cdb_found;
> >> static int        strategy_cdb_replace;
> 
> > These two most definitely are per backend because they hold status 
> > information about the blocks this backend specifically is mucking with. 
> > If it all would be in one function, they would be local variables.
> 
> Would you object if I made 'em actual local variables?  This would
> clutter the strategy API slightly since the vars would have to be passed
> out of some routines and into others, but I think it would be logically
> cleaner.  (In the back of my mind is the idea to support two instances
> of the ARC datastructure, one for global and one for local buffers, so
> minimizing the number of static variables is a prerequisite.)

I am not sure what changes are in store with the bufmgr locking, but
the concurrency could also benefit from having multiple buffer queues.
This would allow the contention for the locks to be further reduced.
The change to a local variable would also enable that change.

Ken Marshall



pgsql-hackers by date:

Previous
From: "Robert Turnbull"
Date:
Subject: Re: Prepared select
Next
From: Ken Ashcraft
Date:
Subject: Probably security hole in postgresql-7.4.1