From owner-freebsd-stable Sat Mar 25 16:33:55 2000 Delivered-To: freebsd-stable@freebsd.org Received: from mail.hcisp.net (Stargate.hcisp.net [208.60.89.18]) by hub.freebsd.org (Postfix) with SMTP id D22FC37B8E7 for ; Sat, 25 Mar 2000 16:33:51 -0800 (PST) (envelope-from tim@mysql.com) Received: (qmail 17868 invoked from network); 26 Mar 2000 00:39:57 -0000 Received: from modem2.hcsip.net (HELO threads.polyesthetic.msg) (208.60.89.68) by stargate.hcisp.net with SMTP; 26 Mar 2000 00:39:57 -0000 Received: (qmail 38659 invoked by uid 1001); 25 Mar 2000 00:16:02 -0000 From: "Thimble Smith" Date: Fri, 24 Mar 2000 19:16:02 -0500 To: Daniel Eischen Cc: freebsd-stable@FreeBSD.ORG Subject: Re: pthread_kill() not killing thread Message-ID: <20000324191602.A38647@threads.polyesthetic.msg> References: <200003242307.SAA08054@pcnet1.pcnet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <200003242307.SAA08054@pcnet1.pcnet.com>; from eischen@vigrid.com on Fri, Mar 24, 2000 at 06:07:30PM -0500 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Mar 24, 2000 at 06:07:30PM -0500, Daniel Eischen wrote: >My "interpretation" of the POSIX spec was that intra-process signals >sent via pthread_kill() were treated differently than if the signal was >sent to the process. I'll have to go back and re-read the POSIX spec -- >perhaps I misunderstood it. > >At any rate, FreeBSDs threads implementation of pthread_kill() will >not have the same effect as kill(2) -- the process will not be terminated >by issuing a pthread_kill(thrd, SIGTERM) to a thread. Signals sent >to threads via pthread_kill will invoke a signal handler if it is >installed and will interrupt the thread from its current operation >(returning -1 with EINTR). This all assumes that the thread isn't >masking the signal, and that the handler isn't installed with SA_RESTART. OK. Thanks. What I'm really trying to do is figure out why MySQL will hang if you try to shut it down when there is a connection open to it. You then have to kill the mysqld process with -9 in order to get rid of it. :( There's a program in the source distribution that tests the thread signal handling: mysys/test_thr_alarm. It hangs in a similar way. I'm trying to figure out why. So, if anybody knows threads well and also has MySQL on their box, and feels like checking it out, I'd be happy. I'm sure I'll figure it out eventually (and it'll be worth it to learn more about threads), but if anybody can do it in a few seconds I'd appreciate it. Tim -- Tim Smith < tim@mysql.com > :MySQL Development Team: Boone, NC USA. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message