Re: [HACKERS] library policy question - Mailing list pgsql-hackers

From Michael Meskes
Subject Re: [HACKERS] library policy question
Date
Msg-id 20000308163010.A512@fam-meskes.de
Whole thread Raw
In response to Re: [HACKERS] library policy question  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, Mar 07, 2000 at 11:34:04AM -0500, Tom Lane wrote:
> > What exactly is our policy towards global variables in libraries?
> 
> Avoid them.

Maybe I've got a brain lock for the moment but what do I do to the list of
connections I have to handle? Since it is used in several functions I cannot
see how to program this without a global variable albeit a static one. What
I need is a mapping of the SQL conenction name to the PGconn structure.

I also wonder if multiple threads should be allowed access to the same
structure, i.e. if one thread opens a new connection should the other one be
allowed to access this too?

BTW libpgeasy does not seem to be able to be used in multi-threading
environments either. Is this library still supported?

Michael
-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De           | Use PostgreSQL!


pgsql-hackers by date:

Previous
From: Michael Meskes
Date:
Subject: Re: [HACKERS] pSQL auth
Next
From: Michael Meskes
Date:
Subject: Re: [HACKERS] library policy question