atom feed18 messages in org.freebsd.freebsd-threadsthreading in FreeBSD (acx_pthreads)
FromSent OnAttachments
Karl H. BeckersFeb 4, 2008 3:50 am 
Dag-Erling SmørgravFeb 4, 2008 7:08 am 
John BaldwinFeb 4, 2008 7:25 am 
Karl H. BeckersFeb 4, 2008 8:05 am 
Daniel EischenFeb 4, 2008 8:16 am 
Daniel EischenFeb 4, 2008 8:22 am 
Dag-Erling SmørgravFeb 4, 2008 8:49 am 
Dag-Erling SmørgravFeb 4, 2008 9:00 am 
Daniel EischenFeb 4, 2008 9:01 am 
Dag-Erling SmørgravFeb 4, 2008 9:09 am 
Daniel EischenFeb 4, 2008 9:13 am 
Karl H. BeckersFeb 4, 2008 9:22 am 
Dag-Erling SmørgravFeb 4, 2008 9:46 am 
Julian ElischerFeb 4, 2008 10:16 am 
Karl H. BeckersFeb 4, 2008 3:05 pm 
John BaldwinFeb 4, 2008 3:16 pm 
Dag-Erling SmørgravFeb 5, 2008 12:25 am 
Dag-Erling SmørgravFeb 5, 2008 12:38 am 
Subject:threading in FreeBSD (acx_pthreads)
From:Karl H. Beckers (karl@gmx.net)
Date:Feb 4, 2008 8:05:13 am
List:org.freebsd.freebsd-threads

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@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.