Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!usc!apple!agate!ucbvax!ucsd!hub.ucsb.edu!henri!doner From: doner@henri.ucsb.edu (John Doner) Newsgroups: comp.sys.mac.system Subject: Re: Preemption good, time-slicing bad (was Re: All about sys 7.0 ) Message-ID: <10227@hub.ucsb.edu> Date: 1 Apr 91 20:39:58 GMT References: <1CE00001.bmpkbkz@tbomb.ice.com> Sender: news@hub.ucsb.edu Reply-To: doner@henri.UUCP (John Doner) Organization: University of California, Santa Barbara Lines: 35 In article <1CE00001.bmpkbkz@tbomb.ice.com> time@ice.com writes: >And also remember, under UNIX (with pre-emptive multitasking), a process >does NOT get CPU time unless it is ready to run. Thus, processes waiting >for input or I/O don't waste "idle" time. > >The problem, in the Macintosh case, is that processes do not "block" >like UNIX processes, they "event loop". This is why the majority of >open programs *will* be taking CPU time, and why it will be less >efficient. I am not sure if or how Apple addressed this under A/UX, >but I believe it was a tough problem. When it's time to consider doing a switch, the decision must be made as to whether a process is "ready to run." This decision must be made either by the operating system, as with UNIX, or by the process itself, as with the Mac. Either way, some cycles are going to be spent making the decision, so it's problematic which method is more efficient, whether inherently or potentially. As to the "event loop" in a Mac application, note that for most Mac applications, handling of a null event is an extremely brief process (with the exception of programs maintaining some sort of continuously visible activity, such as a clock; and in those cases, even a pre-emptive multitasking OS must give them time). I don't believe the current Mac OS allows for priorities among running processes, but I don't see any reason why this feature couldn't be implemented. It's simply a matter of withholding events from the application until the OS decides to release them. Despite what I've said, I too would like to see a pre-emptive multitasking Mac OS. It's just that I'm in less of a hurry to get it, and I don't believe it will have as much benefit as many people seem to think. John E. Doner doner@henri.ucsb.edu (805)893-3941 Dept. Mathematics, UCSB, Santa Barbara, CA 93106