Date: Sat, 25 Nov 2000 04:15:56 -0700 From: Chris Wasser <cwasser@v-wave.com> To: freebsd-questions@FreeBSD.ORG Subject: Re: pthreads library -- bug? Message-ID: <20001125041556.A827@skunkworks.area51-arpa.mil> In-Reply-To: <20001124142912.B2959@dan.emsphone.com>; from dnelson@emsphone.com on Fri, Nov 24, 2000 at 02:29:12PM -0600 References: <3A1E8EF9.3F0C7582@home.com> <20001124142912.B2959@dan.emsphone.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Nov 24, 2000 at 02:29:12PM -0600, Dan Nelson wrote: > In the last episode (Nov 24), Jim DeLisle said: > > I'm miffed on where the pthreads libraries are on a FreeBSD 4.0 > > install. There seems to be on in the /usr/compat/linux/lib directory, > > but I would have thought to have found a FreeBSD native version in > > /usr/lib. > > /usr/lib/libc_r.* are the pthreads libraries. Add the "-pthread" > option to your gcc compile and link lines to use them. I've actually encountered a rather strange thing with the BSD pthreads, with gethostby*() running inside a thread, it seems that neither SIGQUIT or SIGKILL will terminate the thread until it either times out or finishes [using pthread_kill()]. While I haven't investigated this much further, it seems to go all the way back to 4.1-RELEASE ... Is this a 'feature' or a bug? If the latter, I can submit a PR. Would be interested to hear if anyone else has encountered this, or if it's by design. Here's the method I try to terminate the thread with (basically fall through, until one works): 1) Unlock the quit mutex, send a signal to the thread to wakeup. 2) Try to cancel the thread. 3) Issue the inevitable pthread_kill(). To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001125041556.A827>