Removing -pthread from gcc

Daniel Eischen eischen at vigrid.com
Mon Sep 8 15:39:26 PDT 2003


On Fri, 5 Sep 2003, Daniel Eischen wrote:
> 
> On Fri, 5 Sep 2003, Loren James Rittle wrote:
> > Thank you for considering these words.  BTW, wouldn't it be cooler
> > if (example only):
> > 
> > -pthread (whatever the system default)
> > -pthread=1 (1 process, aka -lc_r)
> > -pthread=1:1 (1 process per thread, aka -lthr)
> > -pthread=M:N (M threads in N processes, aka -lkse)
> > -pthread=late/weak (perhaps not good ELF form, link against a stub to
> > which all POSIX thread libraries on FreeBSD must conform, do not
> > record the dependency ala FreeBSD4 default for -lc; or that does it in
> > a weak manner en mass such that binding is deferred to the final
> > selection made at a final link time)
> 
> That's a lot better :-)  The only problem is that we have 2
> different libraries that offer 1:1...
> 
> I would not object to this approach, but I would like to
> temporarily make -pthread (without args) either a NOOP or
> an error in our tree to help correct "shortcoming in ports".

So is there a consensus?  My take is that we make -pthread a
NOOP.

I do have some reservations with -pthread=<threading model>
though.  With all the applications written primarily for
Linux, I am fearful that those applications will use
-pthread=1:1 just because that is Linux' threading model.
The performance, reliability, etc of threading models
will vary from OS to OS, so you'd probably end up basing
the selected threading model on the OS.  This defeats the
point of having a standard compiler option; you might as
well make it a link option (which it already is).

-- 
Dan Eischen



More information about the freebsd-threads mailing list