Date: Mon, 7 Jul 2003 18:53:34 -0400 (EDT) From: Daniel Eischen <eischen@vigrid.com> To: Petri Helenius <pete@he.iki.fi> Cc: freebsd-threads@freebsd.org Subject: Re: thread scheduling priority Message-ID: <Pine.GSO.4.10.10307071847570.16417-100000@pcnet5.pcnet.com> In-Reply-To: <010501c344cf$f66be110$812a40c1@PETEX31>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 8 Jul 2003, Petri Helenius wrote: > > > So when the main thread unlocks the mutex there are two runnable thre= ads, > > > which one keeps running? > > > > The current thread. As I said before, if there are idle KSEs, then > > one is woken to run the newly runnable thread. > > > Although I cannot prove this doesn=B4t happen, I think the other > thread does not get scheduled until a few moments later because > when I get the scenario where thread1 has the mutex, thread2 > is waiting on it, thread1 goes to cpu-bound tasks without > holding the mutex, thread2 is not woken up, at least not immediately. The KSE is woken immediately, but you are at the whimsy of the kernel scheduler. Depending on what else is running, the woken KSE may not run right away. You can see the wakeups using ktrace... --=20 Dan Eischen
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10307071847570.16417-100000>