Subject: Re: Threading problems
To: Eric Haszlakiewicz <erh@nimenees.com>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 11/24/2004 08:42:27
--UugvWAfsgieZRqgk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Nov 24, 2004 at 02:45:11AM -0600, Eric Haszlakiewicz wrote:
> On Tue, Nov 23, 2004 at 06:59:43PM -0800, Bill Studenmund wrote:
> > Also, you're assuming that the program is fine being suddenly-threaded.=
=20
> > Say _it_ is built different if threads are enabled or not. Adding -pthr=
ead=20
> > to the command line defines "_REENTRANT", which a program certainly can=
=20
> > use to change its behavior. Looking in stdio.h, its behavior will be=20
> > different. Some things it does will never be able to work right adding=
=20
> > threading later.
> 	I didn't think of that.  That just about kills my idea.  oh well.

Nor had I until I was composing that EMail.

> > Given how much code really needs to be _REENTRANT or not at compile tim=
e,=20
> > I don't see how we can ever make "magic add pthread later" work right. =
So=20
> > I think what we're doing now is the right thing, by making it obvious t=
he=20
> > code needs recompiling.
>=20
> 	uhm... I guess I'm not entirely up to speed on what all the requirements
> for a threaded program are.  What you're saying seems to imply that
> (going back to the original problem) the postgres binary needs to be built
> with -pthread from the very beginning if it is to dlopen a pthread-linked
> library.  It is not enough to use LD_PRELOAD.  Correct?

Yes, and so the things I was saying were wrong about LD_PRELOAD. A program=
=20
_might_ work, but it's not guaranteed.

Take care,

Bill

--UugvWAfsgieZRqgk
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFBpLnzWz+3JHUci9cRAta3AJ9EsdC8Bp2OwEHnWfjaVS9TZURYxQCeK8G/
mqWMA5jK7p9+yCWCPh2uN3s=
=M3kY
-----END PGP SIGNATURE-----

--UugvWAfsgieZRqgk--