Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!ncar!gatech!mcnc!ncsuvx!news From: kdarling@hobbes.ncsu.edu (Kevin Darling) Newsgroups: comp.sys.amiga.programmer Subject: Re: How do we change the scheduler? (Was Re: Multitasking at home...) Message-ID: <1991Jan17.204425.8037@ncsuvx.ncsu.edu> Date: 17 Jan 91 20:44:25 GMT References: <17210@cbmvax.commodore. <1991Jan10.130741.11570@ux1.cso.uiuc.edu> Sender: news@ncsuvx.ncsu.edu (USENET News System) Organization: NCSU Computing Center Lines: 19 >> Couldn't we decide to not use the real-time facilities of AmigaOS, and >> replace the dispatcher with one that "ages" tasks, ala UNIX, like >> ``every multitasking OS [mike has] worked with [now including AmigaOS].'' > > 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. You'd add one more task structure variable: the Age of the process. AddTask() would be changed to set a new task's initial Age to its Priority. Whenever a task switch takes place, the kernel would first increment all process Ages, and pick by the highest Age. When that process is chosen, its Age is reset to its default Priority. Special wakeup situations might instead choose by Priority (vs Age) to keep a "realtime" reaction. The only difficulty is that the task structure size seems to be hardcoded, so adding a variable might be tough...or does Exec copy the task structure elsewhere on AddTask? kevin