Subject: Re: Threading problems
To: Jaromir Dolecek <jdolecek@NetBSD.org>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-pkg
Date: 11/23/2004 19:08:13
--B0nZA57HJSoPbsHY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Nov 23, 2004 at 10:05:55PM +0100, Jaromir Dolecek wrote:
> Bill Studenmund wrote:
> -- Start of PGP signed section.
> > On Tue, Nov 23, 2004 at 08:47:38PM +0100, Jaromir Dolecek wrote:
> > >=20
> > > Yeah, the libpthread lossage is becoming quite a big problem. Is there
> > > no way to avoid the crash when loading threaded object module
> > > to non-threaded application? We urgently need to come up with
> > > pkgsrc solution for this.
> >=20
> > No, there is no way to avoid the crash. Please see the follow-up I post=
ed=20
> > to darcy@. The server needed to have been compiled with libpthread from=
=20
> > the beginning.
>=20
> But PostgreSQL server itself does not use threads at all, it's using fork=
()
> and shared memory.

So?

The modules it loads want to use pthreads, so it has to be pthread-safe.=20
Given that they want to be threaded, it will end up being one of many=20
threads. Thus it still needs to do locking...

One thing which might be interesting would be if modules that don't really=
=20
need threads but want to be thread safe would use something like=20
threadlib. Either that or we may want to matrix loadable modules (this is=
=20
the threaded one, this is the unthreaded one...)

Take care,

Bill

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

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

iD8DBQFBo/sdWz+3JHUci9cRAlraAJwMNMZLoR5DmahO4NhngVRKx2BpBwCeP85n
T7s3+oHU6n5mPgOMgQyEpUs=
=Nzub
-----END PGP SIGNATURE-----

--B0nZA57HJSoPbsHY--