Help: threading problem in non-threaded applications
Joe Marcus Clarke
marcus at FreeBSD.org
Wed Apr 21 09:28:55 PDT 2004
On Wed, 2004-04-21 at 09:18, Daniel Eischen wrote:
> On Wed, 21 Apr 2004, Joe Marcus Clarke wrote:
>
> > On Tue, 2004-04-20 at 17:08, Daniel Eischen wrote:
> > > On Tue, 20 Apr 2004, Joe Marcus Clarke wrote:
> > >
> > > > 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 threaded
> > > > and non-threaded applications. However, GNOME 2.6 augmented this dialog
> > > > with a dynamically loadable threaded shared object. The GNOME version
> > > > is automatically used by all GTK+ apps when run under a GNOME desktop if
> > > > libgnomeui is installed.
> > >
> > > 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.
> >
> > 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:
>
> 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
--
Joe Marcus Clarke
FreeBSD GNOME Team :: marcus at FreeBSD.org
gnome at FreeBSD.org
FreeNode / #freebsd-gnome
http://www.FreeBSD.org/gnome
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20040421/27fb3c41/attachment.bin
More information about the freebsd-hackers
mailing list