[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Real" Multitasking (Re: GNO questions...)



slp@vax1.mankato.msus.edu writes:

>FYI: People who refer to preemptive multitasking as "real" multitasking are
>people who know sh*t about what's what.  Cooperative multitasking is every
>bit as real (or actually fake) as preemptive multitasking.  (The reason I

Cooperative multitasking seperates the foreground from the background. This
has some bad consequences: First, it means that background operations
are treated differently, written differently, and most of the time a
program must explicitely support cooperative multitasking while programs
automatically support preemptive.

It doesn't make sense to use cooperative on a multi user system. However,
preemptive makes snese on both multi and single user systems. So one
works better than the other (actually not better, but more universally
and in more situations).

OTOH, preemptive is also better. It is more logical too. Cooperative often
feels "jumpy" because of the unequal distribution of time.

Consider a ZModem receive. On premptive, it gets control at given intervals.
If the computer is fast enough, no characters will be missed.

Now take a ZMODEM receive on cooperative. It could go idle for seconds at a
time! Then get control for even longer. The unpredictibility makes it
impossible to correctly receive the file. Most likely the comm program will
resort to an interrupt driven receiver, which defeats the purpose of the
multitasking anyway.

>for multi-user systems.  However, it is less efficient.  A cooperative
>multitasker generally doesn't have to save as much information (ie. registers,
>machine state, etc.) during switches so it is more efficient.  However, it

It also has to save lots of stuff. Besides, what are we talking about? 50
bytes of stuff MAXIMUM! (in prempt) Not all that much needs saving. The
registers, plus a couple softswitches. Stuff like file descriptor tables is
not switched, but looked up when an OS call needs it.

Finally, no cooperative system gives as much control as preeptive systems.
Though I suppose it would be possible to have stuff like a job control
shell (the best way to control a whole bunch of jobs) in coop, there just
isn't.

But really the most important thing is coop's "special casing". Programs
must usually be written specially for as coop system, and the coop
system itself is much less expandible than preempt because it's so
dependant on current interface concepts.

>and disadvantages.  But as a rule of thumb, preemptive multitasking is the
>way to go for multiuser systems, whereas cooperative (Mac-style) multitasking
>is the best way to go for single user systems.  Cooperative multitasking is

This is what you're saying:
	Coop great on single user
	Pre great on multi user
	Therefore single user must use coop and multi must use preempt

This is more correct:
	Coop so-so on single user and impossible on multi
	Pre great on both
	Therefore use preempt!

In other words, Preemptive will work on both, but Coop won't, so why not
use it? (Plus all the other reasons)

Sory for the flame, but I couldn't let that article go.
 ______________________________________________________________________
|~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| Phillip Vandry | Vandry@Cam.Org | Suicide (n.): What to do if Macs   |
|________________|________________|_______________take over the world__|
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~