Path: utzoo!utgpu!watserv1!watmath!att!bellcore!rutgers!cbmvax!martin From: martin@cbmvax.commodore.com (Martin Hunt) Newsgroups: comp.arch Subject: Re: Macintosh OS Message-ID: <12766@cbmvax.commodore.com> Date: 16 Jun 90 02:49:32 GMT References: <1990May30.230248.6200@Neon.Stanford.EDU> <1935@key.COM> <30273@ut-emx.UUCP> <76700207@p.cs.uiuc.edu> <402@newave.UUCP> <1990Jun2.132847.14292@oracle.com> <26437.266ae612@vaxb.acs.unt.edu> <1682@mcrware.UUCP> <12539@cbmvax.com Reply-To: martin@cbmvax (Martin Hunt) Organization: Commodore, West Chester, PA Lines: 42 In article <575@argosy.UUCP> jay@idiot.UUCP (Jay O'Conor) writes: >In article <12539@cbmvax.commodore.com> daveh@cbmvax (Dave Haynie) writes: > >>For every context swap, all kinds of this global context information must be >>stored somewhere. The preemptive system need only store CPU context >>information -- program counter and various registers. > >You're not serious, are you? You don't really mean to imply that >"program counter and various registers" are all there is to a process' >context? I'll grant that the Mac O/S is currently somewhat unweildy in >identifying everything that constitutes a process context, but every O/S >I'm aware of has more than just processor registers that define a >process context. He's serious. On multitasking systems, a context swap is usually just defined by the CPU (and possibly MMU) registers. >Whether the multitasking system is preemptive or cooperative has no >effect on what a process' context is. Preemptive multitasking systems >can have just as much context information as a cooperative multitasking >system - it's just that the context must be private to the process in a >preemptive scheduler, while much of the context can be global with a >cooperative scheduler. I've never seen a preemptive multitasking system with as much context information as a cooperative system, but anything's possible. The reason is that cooperative multitasking systems are usually just a kludge hacked on to basically a single-tasking OS. To swap processes on a Mac, you have to take a snapshot of the current system status and save that each time (that darned global context you mentioned). This means cooperative multitasking systems are always at least as slow as preemptive systems, usually much slower. A cooperative multitasking system could be designed with as little process context as typical preemptive systems, but if you go to that much trouble designing an OS, it wouldn't make any sense to cripple it by not writing a decent scheduler. -- Martin Hunt martin@cbmvax.commodore.com Commodore-Amiga Engineering {uunet|pyramid|rutgers}!cbmvax!martin