Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jul 2004 11:15:54 -0400 (EDT)
From:      Daniel Eischen <eischen@vigrid.com>
To:        Julian Elischer <julian@elischer.org>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: pthread switch  (was Odd KSE panic)
Message-ID:  <Pine.GSO.4.10.10407111115220.22723-100000@pcnet5.pcnet.com>
In-Reply-To: <20040710214817.O33743-100000@idiom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 10 Jul 2004, Julian Elischer wrote:
> 
> On Thu, 8 Jul 2004, Daniel Eischen wrote:
> 
> > Wewll, I just took a look at this.  I had already added a preemption
> > point in pthread_mutex_unlock():
> >
> >   $ cvs log -r1.38 lib/libpthread/thread/thr_mutex.c
> >   ...
> >   description:
> >   ----------------------------
> >   revision 1.38
> >   date: 2003/07/18 02:46:29;  author: deischen;  state: Exp;  lines: +10 -6
> >   Add a preemption point when a mutex or condition variable is
> >   handed-off/signaled to a higher priority thread.  Note that when
> >   there are idle KSEs that could run the higher priority thread,
> >   we still add the preemption point because it seems to take the
> >   kernel a while to schedule an idle KSE.  The drawbacks are that
> >   threads will be swapped more often between CPUs (KSEs) and
> >   that there will be an extra userland context switch (the idle
> >   KSE is still woken and will probably resume the preempted
> >   thread).  We'll revisit this if and when idle CPU/KSE wakeup
> >   times improve.
> >
> > Note that the priority of a runnable thread must be strictly greater
> > than the currently running thread in order for preemption to occur.
> 
> So all Drew should have to do is increas the priority of teh correct
> thread to get it to switch at that point.

Yes.

-- 
Dan Eischen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10407111115220.22723-100000>