threading in FreeBSD (acx_pthreads)
Karl H. Beckers
karl.h.beckers at gmx.net
Mon Feb 4 08:05:33 PST 2008
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 at 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 at des.no
>
>
More information about the freebsd-threads
mailing list