From owner-freebsd-threads@FreeBSD.ORG Fri May 30 22:40:01 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 39E3A37B401 for ; Fri, 30 May 2003 22:40:01 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E8E943F75 for ; Fri, 30 May 2003 22:40:00 -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 h4V5dxNc028322; Sat, 31 May 2003 01:39:59 -0400 (EDT) Date: Sat, 31 May 2003 01:39:59 -0400 (EDT) From: Daniel Eischen To: "Matthew D. Fuller" In-Reply-To: <20030531024932.GP61246@over-yonder.net> 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: Sat, 31 May 2003 05:40:01 -0000 On Fri, 30 May 2003, Matthew D. Fuller wrote: > [ -threads only ] > > On Fri, May 30, 2003 at 07:58:57PM -0400 I heard the voice of > Daniel Eischen, and lo! it spake thus: > > Sometime shortly after 5.1 release, we'll (hopefully) be > > installing libpthread as "libpthread" instead of "libkse" > > by default. > > >From my comfortable position here in the peanut gallery, I've been > thinking about this. Now that we have libthr around (presumably for a > long time), mightn't it be a good idea to keep libkse and libkse, libthr > and libthr, and maybe even libc_r as libc_r, and have libpthread be a > {sym,hard}link to one of the above? No :-) In my mind, the KSE threads library was always supposed to be libpthread (note the 'p' for POSIX). libthr is not able to be fully POSIX compat because the kernel schedules threads and the kernel doesn't conform to POSIX scheduling. I know I'm in the minority, but I think libthr interfaces should "thr_foo()" (similar to Solaris libthread), not "pthread_foo()". But that prevents it from being easily used as a drop-in replacement for libc_r. > Since we're ending up with multiple > libraries implementing the pthreads API, with the presumption that > they're at least nominally interchangeable, might we not want to make > that switchability explicit? Sure, you can link with -lc_r, -lthr, or -lpthread. Or you can link to only one of them and use libmap to globally switch thread libraries. You've even got linux threads. We have a mechanism for selecting the threads library that the ports system should be using (PTHREAD_LIBS); it's just not always being obeyed by some ports. -- Dan Eischen