Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Jan 1999 09:01:34 -0600
From:      "Richard Seaman, Jr." <dick@tar.com>
To:        Jeremy Lea <reg@shale.csir.co.za>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: Using LinuxThreads
Message-ID:  <19990122090134.F5495@tar.com>
In-Reply-To: <19990121123814.B5495@tar.com>; from Richard Seaman, Jr. on Thu, Jan 21, 1999 at 12:38:14PM -0600
References:  <19990118182717.A15566@top.worldcontrol.com> <Pine.BSF.4.05.9901182203500.11971-100000@janus.syracuse.net> <19990119024539.A88383@top.worldcontrol.com> <19990119140613.B826@shale.csir.co.za> <19990119091151.F600@tar.com> <19990121181228.A98581@shale.csir.co.za> <19990121123814.B5495@tar.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 21, 1999 at 12:38:14PM -0600, Richard Seaman, Jr. wrote:
> On Thu, Jan 21, 1999 at 06:12:29PM +0200, Jeremy Lea wrote:
> 
> > On Tue, Jan 19, 1999 at 09:11:51AM -0600, Richard Seaman, Jr. wrote:
> > > Actually, the new version, in FreeBSD "ports" form, doesn't require 
> > > -DLINUXTHREADS anymore, but it does require -I/usr/local/include to
> > > pick up the right header, since it installs a pthread.h into 
> > > /usr/local/include.  This conflicts with the pthread.h in /usr/include.
> > 
> > This is nagging at me.  Having two headers of the same name, but importantly
> > different content is asking for touble.  There needs to be a way to ensure
> > that only one or the other is picked up.  The best way I can think of is to
> > only include the contents of the user thread pthread.h if _THREAD_SAFE is
> > defined (to force people to use the right defines...) and the contents of
> > kernel thread pthread.h if _REENTRANT (and not _THREAD_SAFE) is defined. 
> > This has the added bonus of meaning that most linux apps wont have to be
> > patched.

> Now, on the topic of conflicting pthread.h files, I agree this is a 
> problem.  One choice, which I originally implemented, is to fix
> pthread.h so it pulls in the right data based on a swtich (eg.
> if LINUXTHREADS is defined, pull in LT headers, else pull in
> user threads headers).  I don't like using _THREAD_SAFE for this
> test, for the reason mentioned above.  And I don't like using 
> _REENTRANT because its so widely used and it could still confure
> people.
> 
> The second choice, which is what the current version of the "port"
> does, is to put the conflicting headers in different directories,
> and require the application to define the order of the include
> files to get the right one in.
> 
> There are proglems either way, and I don't really prefer one
> over the other.

Upon further investigation, I'm not sure I agree with myself on this point
anymore.  I've been trying to get gimp compiled to look into the reported
problem Brian Litzinger had.  I notice that glib, gtk+ (both needed for
gimp) and gimp itself generate include search paths that include 
/usr/local/include, which means that the linuxthreads pthread.h will
get picked up even if the user wants the uthread version in /usr/include.

Maybe having just one pthread.h that pulls in the required headers
based on a switch (eg. -DLINUXTHREADS) is the way to go?

-- 
Richard Seamman, Jr.          email: dick@tar.com
5182 N. Maple Lane            phone: 414-367-5450
Chenequa WI 53058             fax:   414-367-5852

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990122090134.F5495>