Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!usc!apple!spies!zorch!xanthian From: xanthian@zorch.SF-Bay.ORG (Kent Paul Dolan) Newsgroups: comp.sys.amiga.advocacy Subject: Re: How do we change the scheduler? (Was Re: Multitasking at home...) Message-ID: <1991Jan16.015035.10356@zorch.SF-Bay.ORG> Date: 16 Jan 91 01:50:35 GMT References: <1991Jan14.221532.4431@cunixf.cc.columbia.edu> <11719@goofy.Apple.COM> Organization: SF-Bay Public-Access Unix Lines: 35 es1@cunixb.cc.columbia.edu (Ethan Solomita) writes: > Problem is, most tasks DON'T give up control. Mac programs have to be > written to purposely give up control and many are still written badly > enough to not work, MicroSoft being one of the worst culprits. (Larry Rosenstein) at googy.apple.com writes: > Not true. For most applications, there is nothing special you have to > do in order to yield the CPU. It is a normal part of processing user > input. Bzzzzt! Wrong answer, but thank you for playing our game. Pausing for i/o is a separate consideration; the "cooperation" required for cooperative multitasking is built into the OS i/o routines. Waiting for i/o _is_ cooperating. It is the case of a routine that goes CPU bound and doesn't bother to give back to the OS the chance to allow another task to execute that differentiates cooperative from preemptive multitasking. For example, a Mandelbrot generator or Ray Tracer that draws to the screen (potentially for hours) and doesn't have a "hey, OS, you need some time?" at the top of some loop, locks up the machine completely in a cooperative multitasking environment. In a preemptive environment, you have to be malicious, not just careless, to sieze complete control of the machine -- you have to deliberately turn off interrupts and never restore them. So long as you leave interrupts enabled, under preemptive multitasking you don't have to ask the OS if it needs time, it will come and wrest time away from you. Kent, the man from xanth.