Date: Mon, 4 Feb 2008 11:16:09 -0500 (EST) From: Daniel Eischen <deischen@freebsd.org> To: "Karl H. Beckers" <karl.h.beckers@gmx.net> Cc: Dag-Erling =?iso-8859-1?Q?Sm=C3=B8rgrav?= <des@des.no>, freebsd-threads@freebsd.org Subject: Re: threading in FreeBSD (acx_pthreads) Message-ID: <Pine.GSO.4.64.0802041112260.13899@sea.ntplx.net> In-Reply-To: <43451.192.9.112.196.1202141118.squirrel@www.our-isp.org> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.64.0802041112260.13899>