Re: Aim of --enable-thread-safety ? - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Aim of --enable-thread-safety ?
Date
Msg-id 20060710181545.GG17723@svana.org
Whole thread Raw
In response to Re: Aim of --enable-thread-safety ?  (Bruce Momjian <bruce@momjian.us>)
List pgsql-general
On Mon, Jul 10, 2006 at 01:39:44PM -0400, Bruce Momjian wrote:
> Uh, the documentation is very clear on the purpose of this option:
>
>        <term><option>--enable-thread-safety</option></term>
>        <listitem>
>         <para>
>          Make the client libraries thread-safe.  This allows
>          concurrent threads in <application>libpq</application> and
>          <application>ECPG</application> programs to safely control
>          their private connection handles.  This option requires adequate
>          threading support in your operating system.
>
> Is there something unclear about it?

Not sure. The way I read it, it doesn't say that it's also important
even if the multithreaded program only has one connection (it uses the
word "handles"). Someone posted a problem not so long ago where he'd
figured he didn't need thread-safety because he was only using one
connection, but it still broke if libpq was called from anything other
than the main thread.

If there is any possibility libpq is going to come in contact with a
multithreaded program (even via a loaded plugin or whatever) you must
have thread-safety enabled or things are likely to break.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: marcelo Cortez
Date:
Subject: encoding bug or feature?
Next
From: Jorge Godoy
Date:
Subject: Re: encoding bug or feature?