Re: PostgreSQL libraries - PThread Support, but not use...

From: Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
To: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: PostgreSQL libraries - PThread Support, but not use...
Date: 2003-01-06 19:01:41
Message-ID: 200301061401.41800.lamar.owen@wgcr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Monday 06 January 2003 12:28, Lee Kindness wrote:
> Tom Lane writes:
> > Lee Kindness <lkindness(at)csl(dot)co(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Vince Vielhaber 2003-01-06 21:06:53 Re: New Portal in Place, DNS switched ...
Previous Message Dan Langille 2003-01-06 19:00:21 Re: New Portal in Place, DNS switched ...

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2003-01-06 22:45:22 IPv6 cleanups
Previous Message Patric Bechtel 2003-01-06 17:54:48 New patch for streaming