From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 09:28:55 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A055B16A4CE for ; Wed, 21 Apr 2004 09:28:55 -0700 (PDT) Received: from creme-brulee.marcuscom.com (rrcs-midsouth-24-172-16-118.biz.rr.com [24.172.16.118]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3260D43D48 for ; Wed, 21 Apr 2004 09:28:55 -0700 (PDT) (envelope-from marcus@FreeBSD.org) Received: from [10.2.1.4] (vpn-client-4.marcuscom.com [10.2.1.4]) i3LGRmaI002876; Wed, 21 Apr 2004 12:27:48 -0400 (EDT) (envelope-from marcus@FreeBSD.org) From: Joe Marcus Clarke To: Daniel Eischen In-Reply-To: References: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-OhXDYIDa9l/9kTwZTw9A" Organization: FreeBSD, Inc. Message-Id: <1082564941.845.6.camel@gyros> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 21 Apr 2004 12:29:01 -0400 X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=ham version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on creme-brulee.marcuscom.com cc: freebsd-hackers@FreeBSD.org Subject: Re: Help: threading problem in non-threaded applications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 16:28:55 -0000 --=-OhXDYIDa9l/9kTwZTw9A Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2004-04-21 at 09:18, Daniel Eischen wrote: > On Wed, 21 Apr 2004, Joe Marcus Clarke wrote: >=20 > > On Tue, 2004-04-20 at 17:08, Daniel Eischen wrote: > > > On Tue, 20 Apr 2004, Joe Marcus Clarke wrote: > > >=20 > > > > I have a problem I'm hoping someone can help me with. GTK+ 2.4 > > > > introduced a new file selection GUI which works just fine in thread= ed > > > > and non-threaded applications. However, GNOME 2.6 augmented this d= ialog > > > > with a dynamically loadable threaded shared object. The GNOME vers= ion > > > > is automatically used by all GTK+ apps when run under a GNOME deskt= op if > > > > libgnomeui is installed. > > >=20 > > > Shared libraries shouldn't link with threading libraries > > > unless they actually create threads behind the scenes. > > > Actually, even so, they could force the (unthreaded) > > > applications that link with them to explicitly supply > > > the thread library in the link option. > >=20 > > And that's the case here. The underlying libraries are creating and > > using threads. But what happens when a non-threaded application loads = a > > thread library via dlopen() (which is the case here)? Here's the stack > > trace I see: >=20 > In that case you're going to have to link the application > to a threads library. I had another thought based on your comments. Since -pthread does the right thing in -CURRENT, why don't we make that the default PTHREAD_LIBS? Why do we explicitly link to -lpthread when that causes shared libs to be linked to threading libraries? If we did -pthread universally, this problem would go away because ORBit would do the right thing in the non-threaded case. Joe --=20 Joe Marcus Clarke FreeBSD GNOME Team :: marcus@FreeBSD.org gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-OhXDYIDa9l/9kTwZTw9A Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBAhqFNb2iPiv4Uz4cRAkYdAJwI41mr2iL8QFegqVtiH4TPretAaACfS5Vh 9r6CdbabUn+K74mXUIlgWgQ= =zqGz -----END PGP SIGNATURE----- --=-OhXDYIDa9l/9kTwZTw9A--