Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Feb 2005 14:20:49 -0500 (EST)
From:      Daniel Eischen <deischen@freebsd.org>
To:        Kazuaki Oda <kaakun@highway.ne.jp>
Cc:        threads@freebsd.org
Subject:   Re: thread accounting in libpthread
Message-ID:  <Pine.GSO.4.43.0502191404330.22284-100000@sea.ntplx.net>
In-Reply-To: <4217707F.9050907@highway.ne.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 20 Feb 2005, Kazuaki Oda wrote:

> Daniel Eischen wrote:
>
> > kse_check_completed() is called after kse_wait().  Do you
> > have local changes that removed it?
> >
>
> No,  I have not changed.  kse_check_completed() is called after kse_wait().
> What I meant in the past e-mail was that in such case there was no
> running thread,
> and so we did not needlessly switch it out.

If there was no running thread before kse_wait(), then after
kse_wait() returns and if there are completed threads, then
either one thread completed or N threads completed.  Either
way, they are all added to the end of the run queue.  But
the run queue must have been empty to begin with, otherwise
kse_wait() would not have been called.  So it doesn't matter
whether they are added to the head or the end of the queue.
If one thread completes, then it will be run right away
since it will be the only thread in the queue.  If N threads
complete (assuming they are all at the same priority) then
the first thread pulled from the completed list will be
run first since it will be the first thread added to the
run queue.

-- 
DE



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