Re: Aim of --enable-thread-safety ?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Christopher Browne <cbbrowne(at)acm(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: Aim of --enable-thread-safety ?
Date: 2006-07-10 18:15:45
Message-ID: 20060710181545.GG17723@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Harshal Shah 2006-07-10 18:30:06 unsubscribe
Previous Message Martijn van Oosterhout 2006-07-10 18:07:58 Re: US Telephone Number Type