Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod!function.mps.ohio-state.edu!vidynath From: vidynath@function.mps.ohio-state.edu (Vidhyanath K. Rao) Newsgroups: comp.sys.amiga.programmer Subject: Re: How do we change the scheduler? (Was Re: Multitasking at home...) Summary: Pure unbridled speculation Message-ID: <1991Jan15.193700.4503@zaphod.uucp> Date: 15 Jan 91 19:37:00 GMT References: <1991Jan10.130741.11570@ux1.cso.uiuc.edu> Sender: news@zaphod.uucp Organization: Me? Organized? Lines: 32 Nntp-Posting-Host: function.mps.ohio-state.edu In article mwm@raven.relay.pa.dec.com (Mike (My Watch Has Windows) Meyer) writes: <>I can't see an easy way to do aging. Others on the net have claimed it <>can be done; I'd be interested in knowing how (no code, just a <>description). <> <>The problem is that aging should be done based on how much CPU a <>process has gotten (recently, at that), not how old it is. The Amiga <>exec doesn't (to my knowledge) collect stats on this. So you have to <>add hooks to do that. Normally, this is done by having a scheduler <>that keeps track of such information. The best I can see doing on the <>Amiga is choosing a regular, always present interrupt, and putting <>code in that to keep track of how many times it interrupts each task. <>This requires a bit of magic, but is doable. I am going by the write up in Mortimore's "Handbook", as these functions are not described in the 1.3 autodoc [t least the disk version]. (That says something, I am sure :-) There are four functions that deal with scheduling: Dispatch(), Schedule(), Reschedule() and Switch(). To age all processes, you will need to change all of these, at the least. If Exec is guarantted to always go through these four functions [no such guarantee exists, to my knowledge], you just have change these functions. Of course, to do aging, you just need a monotonic function of time used by each task. The former is not too hard. But getting the precise time accounting is probably close to impossible without major surgery. -- Vidhyanth Rao It is the man, not the method, that solves function.mps.ohio-state.edu the problem. - Henri Poincare (614)-366-9341 [as paraphrased by E. T. Bell]