On Monday 06 January 2003 12:28, Lee Kindness wrote:
> Tom Lane writes:
> > Lee Kindness <lkindness@csl.co.uk> writes:
> > > are protected, a sqlca for each thread), but of course it relies on
> > > libpq which needs work to share a connection between thrreads.
> > AFAIK, libpq is thread-safe already, it's just not thread-aware.
> > Couldn't this be done without touching libpq at all?
> Certainly, it could. I've not fully investigated the current failings
> of libpq WRT to threading yet. But it's certainly a bit more than I
> stated above. I don't know where the statement that libpq is thread
> safe originated from (I see it's on the website). but at a quick
> glance I believe that krb4, krb5, PQoidStatus(),
> PQsetClientEncoding(), winsock_strerror() need more though
> investigation and non-thread-safe fuctions are also being used (at a
> glance gethostbyname() and strtok()).
Lee, see the AOLserver source code. AOLserver (www.aolserver.com) is a
multithreaded dynamic web server that supports pooled database connections.
One of the supported databases is PostgreSQL (I maintain the driver,
currently). It's dual licensed (AOLserver Public License and GPL). I've not
yet seen a problem that could be traced to libpq not being threadsafe. And
AOLserver certainly would show a non-threadsafe problem, particularly with
sites running OpenACS, which can easily beat the database to death.
BTW: thanks for the Bison RPMs. And I believe the PGDG is appropriate as
well. :-)
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11