From owner-freebsd-threads@FreeBSD.ORG Sun Jun 1 06:29:42 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6551D37B401 for ; Sun, 1 Jun 2003 06:29:42 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C1F443FDD for ; Sun, 1 Jun 2003 06:28:21 -0700 (PDT) (envelope-from eischen@pcnet.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h51DSJNc020749; Sun, 1 Jun 2003 09:28:19 -0400 (EDT) Date: Sun, 1 Jun 2003 09:28:18 -0400 (EDT) From: Daniel Eischen To: Valentin Nechayev In-Reply-To: <20030601074307.GB5594@iv.nn.kiev.ua> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org Subject: Re: Transition plans: libkse->libpthread X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2003 13:29:42 -0000 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