Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!ox.com!tbomb!time From: time@ice.com (Tim Endres) Newsgroups: comp.sys.mac.system Subject: Re: Preemption good, time-slicing bad (was Re: All about sys 7.0 ) Date: Mon, 1 Apr 91 14:54:18 EST Organization: ICE Engineering, Inc. Message-ID: <1CE00001.bmpkbkz@tbomb.ice.com> Reply-To: time@ice.com X-Mailer: uAccess - Mac Release: 1.1.b1 Lines: 36 In article <1991Apr1.221924.3287@waikato.ac.nz>, ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes: > In article <7618@idunno.Princeton.EDU>, bskendig@set.Princeton.EDU > (Brian Kendig) says: > > "Do you want to open up MacWrite II, SuperPaint, HyperCard, and a few > other applications, then have your work in Microsoft Excel be slowed > to a crawl as your Macintosh takes time out every few milliseconds to > make sure MacWrite II hasn't suddenly developed a need to do something? > Preemptive multitasking means that the more applications you have open, > the slower your machine will go..." > > I'd like to clarify a couple of things here: > > * "Preemptive" multitasking means that, if a task becomes ready to > run, and the task that's already running is _lower_ in priority, then > the former can immediately grab the CPU away from the latter. > * If the OS goes one step further, so that a running task is periodically > forced to give up the CPU to another waiting task of the _same_ > priority, then this is called "time-slicing". 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. ------------------------------------------------------------- Tim Endres | time@ice.com ICE Engineering | uupsi!ice.com!time 8840 Main Street | Voice FAX Whitmore Lake MI. 48189 | (313) 449 8288 (313) 449 9208