Date: Mon, 4 Feb 2008 17:05:18 +0100 (CET) From: "Karl H. Beckers" <karl.h.beckers@gmx.net> To: Dag-Erling =?iso-8859-1?Q?Sm=C3=B8rgrav?= <des@des.no> Cc: "Karl H. Beckers" <karl.h.beckers@gmx.net>, freebsd-threads@freebsd.org Subject: Re: threading in FreeBSD (acx_pthreads) 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>
next in thread | previous in thread | raw e-mail | index | archive | help
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" <karl.h.beckers@gmx.net> 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 > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43451.192.9.112.196.1202141118.squirrel>