pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedis libpq thread safe without configure enable_thread_safety=yes
2+ messages / 2 participants
[nested] [flat]
* is libpq thread safe without configure enable_thread_safety=yes
@ 2007-10-25 21:15 andrew klassen <aptklassen@yahoo.com>
0 siblings, 1 reply; 2+ messages in thread
From: andrew klassen @ 2007-10-25 21:15 UTC (permalink / raw)
To: pgsql-interfaces
I want to use the libpq in a multithreaded process. I intend to use two
different connections for two different threads. The requests and results
for each connection will be handled completely by each thread independently.
I tried to set enable_thread_safety and enable_thread_safety_force to yes.
However, the compile fails because of references to pthread routines which are not
supported by my os. Specifically:
../../../src/interfaces/libpq/libpq.so: undefined reference to `pthread_sigmask'
../../../src/interfaces/libpq/libpq.so: undefined reference to `pthread_mutex_unlock'
../../../src/interfaces/libpq/libpq.so: undefined reference to `pthread_mutex_lock'
../../../src/interfaces/libpq/libpq.so: undefined reference to `sigwait'
I can change the code to fix this, but I wondering if based on my application it is okay
to just configure without setting enable_thread_safety.
Thanks for any help.
Andrew
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: is libpq thread safe without configure enable_thread_safety=yes
@ 2007-10-25 22:03 Alvaro Herrera <alvherre@commandprompt.com>
parent: andrew klassen <aptklassen@yahoo.com>
0 siblings, 0 replies; 2+ messages in thread
From: Alvaro Herrera @ 2007-10-25 22:03 UTC (permalink / raw)
To: andrew klassen <aptklassen@yahoo.com>; +Cc: pgsql-interfaces
andrew klassen wrote:
> I want to use the libpq in a multithreaded process. I intend to use two
> different connections for two different threads. The requests and results
> for each connection will be handled completely by each thread independently.
> I tried to set enable_thread_safety and enable_thread_safety_force to yes.
> However, the compile fails because of references to pthread routines which are not
> supported by my os. Specifically:
>
> ../../../src/interfaces/libpq/libpq.so: undefined reference to `pthread_sigmask'
> ../../../src/interfaces/libpq/libpq.so: undefined reference to `pthread_mutex_unlock'
> ../../../src/interfaces/libpq/libpq.so: undefined reference to `pthread_mutex_lock'
> ../../../src/interfaces/libpq/libpq.so: undefined reference to `sigwait'
>
> I can change the code to fix this, but I wondering if based on my application it is okay
> to just configure without setting enable_thread_safety.
It is not. libpq itself may be fine, but other libraries it calls to
are likely not, which is why certain operations are locked.
Your pthread support is rather pathetic if it can't do
pthread_mutex_lock anyway ...
--
Alvaro Herrera http://www.flickr.com/photos/alvherre/
"I call it GNU/Linux. Except the GNU/ is silent." (Ben Reiter)
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2007-10-25 22:03 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-10-25 21:15 is libpq thread safe without configure enable_thread_safety=yes andrew klassen <aptklassen@yahoo.com>
2007-10-25 22:03 ` Alvaro Herrera <alvherre@commandprompt.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox