Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Aug 1998 18:35:30 -0500 (CDT)
From:      "Daniel M. Eischen" <deischen@iworks.interworks.org>
To:        info@highwind.com, owner-freebsd-stable@FreeBSD.ORG
Cc:        freebsd-stable@FreeBSD.ORG, gilem@wsg.net
Subject:   Re: threads bug
Message-ID:  <199808102335.SAA20138@iworks.interworks.org>

next in thread | raw e-mail | index | archive | help
> > 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808102335.SAA20138>