Re: PGconn thread safety - Mailing list pgsql-general

From Tom Lane
Subject Re: PGconn thread safety
Date
Msg-id 24298.1044602058@sss.pgh.pa.us
Whole thread Raw
In response to Re: PGconn thread safety  (Neil Conway <neilc@samurai.com>)
Responses Re: PGconn thread safety  (Shridhar Daithankar <shridhar_daithankar@persistent.co.in>)
List pgsql-general
Neil Conway <neilc@samurai.com> writes:
> On Thu, 2003-02-06 at 21:19, ahoward wrote:
>> does anyone know if PGconns are safe to use from multiple threads of control?

> http://www.ca.postgresql.org/users-lounge/docs/7.3/postgres/libpq-threading.html

> "libpq is thread-safe as of PostgreSQL 7.0, so long as no two threads
> attempt to manipulate the same PGconn object at the same time."

That's the theory anyway.  I believe it actually is free of unsafe uses
of static variables.  However, someone recently pointed out that it uses
some libc routines that probably aren't thread-safe; so there's some
cleanup yet to do before we can claim real thread safety.

            regards, tom lane

pgsql-general by date:

Previous
From: Shridhar Daithankar
Date:
Subject: Re: Database access problem : SOS
Next
From: Tom Lane
Date:
Subject: Re: AllocSetAlloc() error message