From owner-freebsd-threads@FreeBSD.ORG Fri May 23 15:33:50 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 E219F37B401 for ; Fri, 23 May 2003 15:33:50 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1D90343F3F for ; Fri, 23 May 2003 15:33:50 -0700 (PDT) (envelope-from eischen@pcnet1.pcnet.com) Received: from pcnet1.pcnet.com (localhost [127.0.0.1]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h4NMXmwQ001421; Fri, 23 May 2003 18:33:48 -0400 (EDT) Received: from localhost (eischen@localhost)h4NMXmvX001416; Fri, 23 May 2003 18:33:48 -0400 (EDT) Date: Fri, 23 May 2003 18:33:48 -0400 (EDT) From: Daniel Eischen To: Craig Rodrigues In-Reply-To: <20030523221953.GA1117@attbi.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: basic thread question 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: Fri, 23 May 2003 22:33:51 -0000 On Fri, 23 May 2003, Craig Rodrigues wrote: > On Fri, May 23, 2003 at 10:57:30AM -0400, Daniel Eischen wrote: > > Either link to libkse or libthr (-lkse or -lthr). Don't use > > libc_r (-pthread or -lc_r). Libkse will set the concurrency > > to the number of CPUs in your system. You can also use > > scope system threads with libkse. > > Hi, > > The FreeBSD KSE web page does not mention -lkse, but > instead it mentions linking against libpthreads. > > Does this web page need to be updated? It mentions > linking against libpthreads and libpthread. I don't know; it's a question of timing. After -release and when rtld-elf gets fixed (kan is working on it right now), it'll go back to being installed as libpthread. Does this work for you? Index: index.sgml =================================================================== RCS file: /home/dcvs/www/en/kse/index.sgml,v retrieving revision 1.11 diff -u -r1.11 index.sgml --- index.sgml 3 May 2003 21:17:01 -0000 1.11 +++ index.sgml 23 May 2003 22:32:52 -0000 @@ -58,21 +58,13 @@ the KSE-related changes (the changes are inextricable from the FreeBSD scheduler). -

In order to use KSE in an application, you need to link it against - libpthreads, which is not built by default. To build and install it - on your system, either run make all install from - /usr/src/lib/libpthread (if you have - sources installed on your system), or check out the - libpthread and - libc modules from CVS. You don't need to - rebuild libc, but the libpthread makefiles refer to parts of the - libc sources.

-

Linking an application against libpthread is straightforward. In its makefiles, change the -pthread option to -lpthread and relink. Alternatively, you can copy libpthread.so on top of libc_r.so, but this is not recommended until libpthread.so becomes a - bit more stable. + bit more stable. Please note that at this time, libpthread is installed + as libkse to prevent autoconf and the like from picking up libpthread + instead of libc_r (use -lkse instead of -lpthread).

Further Reading

-- Dan Eischen