RE: [HACKERS] Threads - Mailing list pgsql-hackers

From Magnus Hagander
Subject RE: [HACKERS] Threads
Date
Msg-id 215896B6B5E1CF11BC5600805FFEA82101F70BF4@sirius.edu.sollentuna.se
Whole thread Raw
Responses Re: [HACKERS] Threads
List pgsql-hackers
:
> > Hmm, what about threads in the frontend? Anyone know if 
> libpq is thread
> > safe, and if not, how hard it might be to make it so?
> 
> It is not; the main reason why not is a brain-dead part of 
> the API that
> exposes modifiable global variables.  Check the mail list archives
> (probably psql-interfaces, but maybe -hackers) for previous 
> discussions
> with details.  Earlier this year I think, or maybe late 98.

Hmm. Really?
AFAIK, only:
pgresStatus[]

is exported, and that one is a) read-only and b) deprecated, and replaced
with a function.

No?

Otherwise, I've been darn lucky in the multithreaded stuff I have :-) (I run
with a different PGconn for each thread, and the PGresult:s are protected by
CriticalSections (this is Win32)). And if that's it, then I really need to
fix it...


//Magnus


pgsql-hackers by date:

Previous
From: Duane Currie
Date:
Subject: Re: [HACKERS] Threads
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] pg_upgrade may be mortally wounded