From owner-freebsd-threads@FreeBSD.ORG Mon Feb 4 16:05:33 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 2614316A417 for ; Mon, 4 Feb 2008 16:05:33 +0000 (UTC) (envelope-from karl.h.beckers@gmx.net) Received: from grotesk.our-isp.org (www.our-isp.org [82.165.43.21]) by mx1.freebsd.org (Postfix) with ESMTP id 94E0E13C4CC for ; Mon, 4 Feb 2008 16:05:27 +0000 (UTC) (envelope-from karl.h.beckers@gmx.net) Received: from www.our-isp.org (localhost [127.0.0.1]) by grotesk.our-isp.org (Postfix) with ESMTP id 0E46026758; Mon, 4 Feb 2008 17:05:18 +0100 (CET) Received: from 192.9.112.196 (SquirrelMail authenticated user khb@jarre-de-the.net) by www.our-isp.org with HTTP; Mon, 4 Feb 2008 17:05:18 +0100 (CET) Message-ID: <43451.192.9.112.196.1202141118.squirrel@www.our-isp.org> In-Reply-To: <86ve54epyy.fsf@ds4.des.no> References: <5913.192.9.112.196.1202124683.squirrel@www.our-isp.org> <86ve54epyy.fsf@ds4.des.no> Date: Mon, 4 Feb 2008 17:05:18 +0100 (CET) From: "Karl H. Beckers" To: Dag-Erling =?iso-8859-1?Q?Sm=C3=B8rgrav?= User-Agent: SquirrelMail/1.4.4 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Cc: "Karl H. Beckers" , freebsd-threads@freebsd.org 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 16:05:33 -0000 Thanks so far, acx_pthread is this autoconf m4 macro: http://ac-archive.sourceforge.net/ac-archive/acx_pthread.html It looks rather promising. And while I might copy it over and fix it locally, I would like to escalate this upstream, if the algorithm there is wrong. Either way, I'd need to know what the correct way is. What I understood now is: On current versions -lpthread should work. On some older versions I should be using -lthr (so not -lc_r, then?). Is there a safe way to check whether we're running a version that needs -lthr? In the varnish example you provided, I cannot find a check for it?!? Thanks, Karl. On Mon, February 4, 2008 3:49 pm, Dag-Erling Smørgrav said: > "Karl H. Beckers" writes: >> I'm trying to move my configure.in from manual threading libs detection >> to acx_pthreads [...] > > I have no idea what acx_pthread is, but judging from your description, > it doesn't seem to do a very good job. There's nothing wrong with > manual detection - see how Varnish does it: > > http://varnish.projects.linpro.no/browser/trunk/varnish-cache/configure.ac > > Note that the correct idiom according to POSIX is -lpthread, so that > should in theory work on all POSIX platforms. The reason why Varnish > checks for -lthr explicitly is that there are FreeBSD versions where > -lpthread defaults to -lkse instead of -lthr, and -lkse has proven to > break rather badly under load. > > DES > -- > Dag-Erling Smørgrav - des@des.no > >