Date: Tue, 9 May 2006 16:50:39 -0500 From: Dan Nelson <dnelson@allantgroup.com> To: Mark Kent <mark@noc.mainstreet.net> Cc: freebsd-questions@freebsd.org Subject: Re: threads in 5.4 and 5.5 Message-ID: <20060509215039.GB94315@dan.emsphone.com> In-Reply-To: <20060509213253.3F23128456@noc.mainstreet.net> References: <20060509213253.3F23128456@noc.mainstreet.net>
next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (May 09), Mark Kent said: > What is the canonical way to compile programs that use posix threads > on freebsd 5.4+, with gcc? > > I've seen comments that say that -pthread, used in 4.x, should go > away for 5.x. But, for example, /usr/ports/security/openssl uses > -pthread. -pthread is still the recommended way, I think. > And what does it mean when a program works with one thread > library and not another? I've got a case like this: > > libpthread.so.1: chew up cpu, then SEGV > libthr.so.1: chew up cpu, but works! > libc_r.so.5: works great! > > This is changed with libmap.conf. > > Does this point to any particular shady coding practice? Could point to a race between two threads that is only lost when the threads actually run on two CPUs. libc_r switches between threads on a single processor, where libthr and libpthread allow multiple threads to execute at once. -- Dan Nelson dnelson@allantgroup.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060509215039.GB94315>