Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Jun 2003 09:28:18 -0400 (EDT)
From:      Daniel Eischen <eischen@pcnet.com>
To:        Valentin Nechayev <netch@iv.nn.kiev.ua>
Cc:        threads@freebsd.org
Subject:   Re: Transition plans: libkse->libpthread
Message-ID:  <Pine.GSO.4.10.10306010921280.19973-100000@pcnet5.pcnet.com>
In-Reply-To: <20030601074307.GB5594@iv.nn.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 1 Jun 2003, Valentin Nechayev wrote:

>  Sat, May 31, 2003 at 01:39:59, eischen (Daniel Eischen) wrote about "Re: Transition plans: libkse->libpthread": 
> 
> DE> No :-)  In my mind, the KSE threads library was always supposed
> DE> to be libpthread (note the 'p' for POSIX).  libthr is not able
> DE> to be fully POSIX compat because the kernel schedules threads
> DE> and the kernel doesn't conform to POSIX scheduling.  I know I'm
> DE> in the minority, but I think libthr interfaces should "thr_foo()"
> DE> (similar to Solaris libthread), not "pthread_foo()".  But that
> DE> prevents it from being easily used as a drop-in replacement
> DE> for libc_r.
> 
> Can you link one app both with libthr and libpthread? I think no ;)

No, that's not what I'm saying at all.

> You can add thr_* as alias or for any function specific to libthr,
> but there are no direct reason to prohibit libthr having pthread interface.
> 
> DE> We have a mechanism for selecting the threads library that
> DE> the ports system should be using (PTHREAD_LIBS); it's just
> DE> not always being obeyed by some ports.
> 
> How about customizing -pthread or -lpthread flags on GCC level?
> (Untested idea)

Why is there confusion?  The linker already supports this in -current.
We can choose to link to any threads library just by specifying
-lc_r, -lthr, or -lpthread.  All you need to do is set PTHREAD_LIBS
to whichever one you choose.  If you want to build mozilla with
libthr, set PTHREAD_LIBS accordingly.  In another window, if you
want to build KDE with libpthread, set PTHREAD_LIBS to -lpthread.
Mozilla will be built linked to libthr.so.1, and KDE linked to
libpthread.so.1.  You can run them both at the same time without
any problem and they will both be using different thread libraries.

If you find one application works better with one library, and
another application works better with a different threads library,
this lets you pick and choose.

-- 
Dan Eischen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10306010921280.19973-100000>