Re: VC2005 build and pthreads

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Douglas McNaught <doug(at)mcnaught(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, Joachim Wieland <joe(at)mcknight(dot)de>, Gevik Babakhani <pgdev(at)xs4all(dot)nl>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: VC2005 build and pthreads
Date: 2007-02-05 16:29:51
Message-ID: 20070205162951.GD4811@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 05, 2007 at 11:09:06AM -0500, Tom Lane wrote:
> I think the real point is that you get the same C library whether you
> ask for thread safety or not, and it does internal locking to protect
> itself against multi threads anyway. So arguably there's no point in
> building a thread-unsafe version of libpq.

The underlying issue is that there is no way to be sure a program will
not have threads. Just because you didn't compile against pthreads,
don't mean there won't be any threads. An example being a
gethostbyname() that loads a threaded version of an LDAP library, for
example.

For programs it doesn't matter, but for shared-libraries you never know
whether you're going to be called from the main thread of execution or
not, and if you're not you're buggered.

> But having said that, 99.99% of Linux use is based on pre-built RPMs,
> and the RPM packagers all understand how to make this decision, so
> it's really not our problem to fix.

That's true, but I think it would be worthwhile to invert the switch to
be --disable-thread-safety, since the number of people who don't
understand the problem far outweigh the cost of the switch.

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-02-05 16:34:23 Re: VC2005 build and pthreads
Previous Message Kris Jurka 2007-02-05 16:26:37 Re: Referential Integrity and SHARE locks