From owner-freebsd-stable Mon Aug 10 16:31:32 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA18660 for freebsd-stable-outgoing; Mon, 10 Aug 1998 16:31:32 -0700 (PDT) (envelope-from owner-freebsd-stable@FreeBSD.ORG) Received: from iworks.interworks.org (iworks.interworks.org [128.255.18.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA18638; Mon, 10 Aug 1998 16:31:25 -0700 (PDT) (envelope-from deischen@iworks.interworks.org) Received: (from deischen@localhost) by iworks.interworks.org (8.8.7/8.8.7) id SAA20138; Mon, 10 Aug 1998 18:35:30 -0500 (CDT) Date: Mon, 10 Aug 1998 18:35:30 -0500 (CDT) From: "Daniel M. Eischen" Message-Id: <199808102335.SAA20138@iworks.interworks.org> To: info@highwind.com, owner-freebsd-stable@FreeBSD.ORG Subject: Re: threads bug Cc: freebsd-stable@FreeBSD.ORG, gilem@wsg.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > Anyone have details on that libc_r.a problem with Mysql. We (at > > HighWind) have had a few issues with libc_r and John Birrell has been > > fast to address them. > > mysql hangs upon giving it a shutdown command. It doesn't seem to > spinning, as CPU usage is low. mysql requires a kill -9 to stop. I was recently having problems porting the run-time of the latest version of GNAT to FreeBSD/pthreads. I figured out the problem to be related to priorities. Ada was assuming priorities in the range of 0 .. 31, so all tasks were getting created with priorities within this range. (An Ada task is created as a thread). But the main program was never having it's priority explicitly set, so it was defaulting to a priority of 64 (the FreeBSD pthreads default priority). When trying to terminate an application, the main program signals (cond_signal) two tasks created at run-time to terminate. One of these tasks is an interrupt manager task and runs at the highest priority (31). The main program assumes that this task will see the signal and properly terminate. But because the main programs priority was higher (64 vs 31), the interrupt manager was never getting a chance to run and terminate. Hence the main program waited indefinitely. The solution was to base Ada priorities around FreeBSDs default thread priority of 64. It was a one-line fix to the GNAT run-time, but it took a while to figure out. Could Mysql be having a similar problem? Dan Eischen deischen@iworks.InterWorks.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message