From owner-freebsd-threads@FreeBSD.ORG Mon Feb 4 23:16:48 2008 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA62316A417; Mon, 4 Feb 2008 23:16:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id 0EA2913C442; Mon, 4 Feb 2008 23:16:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8s) with ESMTP id 230850007-1834499 for multiple; Mon, 04 Feb 2008 18:00:41 -0500 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m14N0STa072283; Mon, 4 Feb 2008 18:00:35 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-threads@freebsd.org Date: Mon, 4 Feb 2008 14:56:30 -0500 User-Agent: KMail/1.9.7 References: <5913.192.9.112.196.1202124683.squirrel@www.our-isp.org> <58004.192.9.112.196.1202145786.squirrel@www.our-isp.org> In-Reply-To: <58004.192.9.112.196.1202145786.squirrel@www.our-isp.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200802041456.30785.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 04 Feb 2008 18:00:36 -0500 (EST) X-Virus-Scanned: ClamAV 0.91.2/5686/Mon Feb 4 16:13:58 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.1 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00, DATE_IN_PAST_03_06 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: "Karl H. Beckers" , Daniel Eischen , Dag-Erling =?iso-8859-1?q?Sm=C3=B8rgrav?= Subject: Re: threading in FreeBSD (acx_pthreads) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2008 23:16:48 -0000 On Monday 04 February 2008 12:23:06 pm Karl H. Beckers wrote: > whoa, > > slowly please, you're loosing me. So, there is: > > -lthr > -pthread > -lpthread > -lc_r > lthread > -kthread > > I've read one opinion (a) saying I should use: > -lthr -lpthread -lc_r (because -pthread might not be safe on all versions) > > the autoconf module (b) does: > -kthread lthread -pthread (now what's -kthread and lthread and how do they > relate to -lthr or -lc_r) > > And the other opinion (c) I heard was: > -pthread -lc_r (and leave anything else to the user and PTHREAD_LIBS) > > And I take it that (c) is what your ports system is doing and the > discussion is around whether that's the right thing to do? Just -pthread, no -lc_r. On 4.x -pthread expands to -D_REENTRANT -lc_r (or something like that). On 5.x+ -pthread expands to -lpthread. IOW, -pthread always expands to the appropriate system default. If you want to use libthr on 6.x then you can either explicitly say -lthr instead of -pthread or rename libpthread to libkse and symlink libpthread to libthr. (Or use libmap.conf to map libpthread to libthr, etc.). Also, FWIW DES, at work when folks did benchmarks for Java stuff on 6.x, libkse had better performance than libthr. Granted, Java is a bit more of an odd benchmark b/c it is thread happy and thus more suited to a M:N model than most other threading workloads. -- John Baldwin