From: putzolu@toadflax.cs.ucdavis.edu (David Putzolu)
Newsgroups: comp.sys.mac.advocacy
Subject: Re: the NeXT option (Was Re: 7.1 vs. OS/2 and Windows NT)
Date: 16 Oct 92 18:58:22 GMT
Organization: Department of Computer Science, University of California, Davis

In article <ewright.719083616@convex.convex.com> ewright@convex.com (Edward V. Wright) writes:
>In <1992Oct13.040531.20757@trl.oz.au> soh@tmp_ip_003.trl.OZ.AU (Soh Kam Hung) writes:
>
>>ewright@convex.com (Edward V. Wright) writes:
>
>>``Pre-emptive multitasking'' usually means the operating system decides
>>which waiting process gets to use the processor.  The process priority
>>can be used to determine how many time units or how long the process
>>uses the processor.
>
>Okay, this is about the third definition of preemptive multitasking
>we've heard.  By this one, the Macintosh is preemptive multitasking
>also.  The OS decides which waiting process gets to use the processor
>whenever a call to GetNextEvent or WaitNextEvent occurs.

You ignored the second sentence of the first paragraph. "The process
priority can be used to determine ... how long the process uses the
processor." This does not happen in System 7. The process itself
determines how long it can use the processor, via the call to
Get/WaitNext Event. The key part of the phrase "preemtive
multitasking" that differentiates it from what S7 does is
preemptive. The mac is obviously not preemptive, even by the`
above definition.

While for many uses a cooperative system like S7 has is just fine,
I would argue that a preemptive system has some definite
advantages, and not many disadvantages. The argument that has
been posted often by E. Wright goes something like this: The reason
that S7 uses cooperative MT is because it allows the foreground
process to use as many processor cycles as necessary to give the
user a feeling of responsiveness. He points out the slowness of
the X-Windowing system as an example of how a preemptive MT
system cannot give such responsiveness. For starters, this is
an unfair comparison. X-Windows is MUCH more than a simple
windowing system. It is more analogous to Carbon Copy (C) or
Timbuktu (C) in that it is split into two separate processes -
a server and a client. Like CC & Timbuktu, these processes can
be run on completely different machines, communicating via a
network. This is what the X system was designed for. A more fair
comparison would be to PM in OS/2 or the Amiga OS, both of which
are preemptive and both of which have GUI's. While X often
feels slow on a workstations rated at 20+ SpecMarks, AmigaOS
does ok on a 3000 (< 5 SpecMarks).
How would a preemptive OS be better? Try to download a
file via zmodem at 9600 baud in the background while loading
Microsoft Word. It will abort. Try to do anything while formatting
a floppy disk (this one is old, I know). Try to do anything while
loading a program over AppleTalk. 
The reason a preemptive OS can and often is better is simple:
information. The OS is the only program which knows exactly
which process NEEDS cpu cycles, and which can wait for a little
while. When I am doing a DL in the background, my comm program
NEEDS cpu cycles - only 5-10% of them, but it needs them
regularly. When I try to load Word while doing this I lose
my DL, because WORD (and the cooperative MT) is not smart
enough to realize this need. I would be willing to wait an
extra 10 seconds for Word to load if I did not have to
restart my download. Similarly, formatting floppies is a low
priority thing - if I am doing some work in Think C, for
example, I don't care if the floppy takes a little longer.
The same goes for loading a program. I might be working on
Word on a paper and think, "Hey, I will need a diagram for
this paper. Better start up my graphics program of choice."
So I double click on Canvas 3.0 (I wish) and wait at least
two minutes. If this was preemptive MT, I could spend those
two minutes working on my paper in word. It's little things
like this which would benefit from preemptive MT.

| David M. A. Putzolu               | putzolu@cs.ucdavis.edu              |
| Senior Undergraduate              | op disclaimer(opinion : ptr mine)   |
| Computer Science and Psychology   |      Money? Who needs money?        |
| University of California at Davis |          I've got fish!             |