From owner-freebsd-threads@FreeBSD.ORG Mon Feb 4 16:16:19 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 7B1B016A419 for ; Mon, 4 Feb 2008 16:16:19 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id 7F18413C455 for ; Mon, 4 Feb 2008 16:16:14 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.2/8.14.2/NETPLEX) with ESMTP id m14GG9Ps024622; Mon, 4 Feb 2008 11:16:09 -0500 (EST) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.0 (mail.netplex.net [204.213.176.10]); Mon, 04 Feb 2008 11:16:10 -0500 (EST) Date: Mon, 4 Feb 2008 11:16:09 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: "Karl H. Beckers" In-Reply-To: <43451.192.9.112.196.1202141118.squirrel@www.our-isp.org> Message-ID: References: <5913.192.9.112.196.1202124683.squirrel@www.our-isp.org> <86ve54epyy.fsf@ds4.des.no> <43451.192.9.112.196.1202141118.squirrel@www.our-isp.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Dag-Erling =?iso-8859-1?Q?Sm=C3=B8rgrav?= , 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 Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2008 16:16:19 -0000 On Mon, 4 Feb 2008, Karl H. Beckers wrote: > Thanks so far, > > acx_pthread is this autoconf m4 macro: > http://ac-archive.sourceforge.net/ac-archive/acx_pthread.html I don't see anything wrong with that macro. If I understand it correctly, it should work on FreeBSD and pick up "-pthread". > 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?). No, do not use -lpthread. Refer to John Baldwin's response, -pthread is what you should be using. Also, our ports system allows one to override -pthread (the default) with PTHREAD_LIBS and PTHREAD_CFLAGS. I suspect that part of the macro came from us (FreeBSD). Please do not escalate anything upstream without checking with our ports team, as it looks like the m4 macro has already been adjusted for FreeBSD. > 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?!? -- DE