Date: Mon, 19 Jul 2004 00:57:14 +0300 From: Alex Keahan <alex@hightemplar.com> To: threads@freebsd.org Subject: Re: A way to build and install libpthread as 1:1 as well as M:N? Message-ID: <200407190057.14164.alex@hightemplar.com> In-Reply-To: <Pine.GSO.4.10.10407181224340.28820-100000@pcnet5.pcnet.com> References: <Pine.GSO.4.10.10407181224340.28820-100000@pcnet5.pcnet.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 18 Jul 2004 7:30 pm, Daniel Eischen wrote: > On Sun, 18 Jul 2004, Robert Watson wrote: > > I'm doing some stability and performance testing as part of the network > > stack locking work. I'd like a way to easily plug and play the > > configuration of libpthread at run-time (although restarting apps is > > fine, rebooting is less preferable, as is actually rebuilding!). It > > looks like right now if I want to switch the operating mode of libpthread > > to 1:1, I have to recompile it with different compile options and have a > > separate library floating around that I plug. Could we arrange for it to > > be a runtime switch of some sort (perhaps read once when the app starts), > > or build the library both ways by default and intall with different > > names? > > The way to do this so it is switchable without relinking > the application (and without using libmap.conf) is to use > LD_LIBRARY_PATH. You can install libpthread built as 1:1 > anywhere you like and just set LD_LIBRARY_PATH to wherever > it is installed. > > If you want both 1:1 and M:N versions of libpthread installed > by default, we have to decide where to install the 1:1 version. > I would recommend 1:1 go in lib/lwp/libpthread.so.1 and M:N > in lib/libpthread.so.1. You could change "lwp" to "kse" > or something else. How about: M:N libpthread: /usr/lib/libpthread.so 1:1 libpthread: /usr/lib/lwp/libpthread.so 1:1 libthr: /usr/lib/thr/libpthread.so? or M:N libpthread: /usr/lib/libpthread.so 1:1 libpthread: /usr/lib/kse/libpthread.so 1:1 libthr: /usr/lib/lwp/libpthread.so? I think all the POSIX thread libraries should be called "libpthread.so" instead of libpthread, libthread, libc_r. Then you can compile things once and select the library you want at runtime by setting the dynamic linker search path (or at link time using the -R linker switch.) In essense, this would be similar to Solaris. Solaris 8 has two POSIX threads libraries (libpthread.so): M:N, located in /usr/lib (32-bit) and /usr/lib/sparcv9 (64-bit), and 1:1, located in /usr/lib/lwp (32-bit) and /usr/lib/lwp/sparcv9 (64-bit) Solaris 9 has only one libpthread (1:1) in: /usr/lib (32-bit) and /usr/lib/sparcv9 (64-bit) (Their 1:1 libpthread is probably more like our "libthr" than "libkse/libpthread in 1:1 mode".) As a side note, Solaris also has a "libthread" which is *not* a POSIX thread library - it implements "Solaris threads" - it's *not* like our libthr which implements *POSIX threads*. Alex Keahan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200407190057.14164.alex>