Date: Fri, 20 Sep 2002 12:59:57 -0700 (PDT) From: Julian Elischer <julian@elischer.org> To: Rik van Riel <riel@conectiva.com.br> Cc: Gary Thorpe <gathorpe79@yahoo.com>, freebsd-arch@freebsd.org Subject: Re: New Linux threading model Message-ID: <Pine.BSF.4.21.0209201258570.16925-100000@InterJet.elischer.org> In-Reply-To: <Pine.LNX.4.44L.0209201640450.1857-100000@imladris.surriel.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 20 Sep 2002, Rik van Riel wrote: > On Fri, 20 Sep 2002, Gary Thorpe wrote: > > > So what happens if a processes has been sitting in the > > queue waiting for a very long time: depending of the > > scheduling algorithm, it may need to have its priority > > increased the longer it waits but this will not > > happen...until it is scheduled? Can this lead to > > starvation? > > Nope, the O(1) scheduler has some tricks to avoid > starvation. The main thing here is that it uses > 2 priority arrays, one for tasks that have time in > their current time slice left (current) and one > or tasks that have run out of time slice (expired). > > As long as the tasks on the expired queue aren't > being starved yet, interactive tasks hop on and off > the current priority array and the expired tasks > just sit there ... > > ... but once the oldest task on the expired array > has been sitting there for some time (default is 3 > seconds, I think) the kernel will add newly woken > up tasks to the expired array. > > It will keep running the tasks from the current > array until the time slices are all gone and then > it switches arrays, running tasks from the expired > array. > > No starvation. > > > > There don't seem to be any O(n) loops left in or > > > near this scheduler, > > > meaning that 1:1 threading with lots of threads > > > becomes possible. > > > > The maximum parallelism on a given SMP system can > > never be more than the number of CPUs so wouldn't a 1 > > : 1 model lead to unnecessary overhead? > > Your threads never block on IO ? Or page faults, for that matter ? Ah yes but in KSE, just the thread blocks and an upcall gives the CPU back to the userland scheduler to run another thread shoudl ther ebe one ready.. > > regards, > > Rik > -- > Bravely reimplemented by the knights who say "NIH". > > http://www.surriel.com/ http://distro.conectiva.com/ > > Spamtraps of the month: september@surriel.com trac@trac.org > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-arch" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0209201258570.16925-100000>