|
Unix Programming - The Elements of Operating-System Style - Multitasking Capability
Multitasking Capability
One of the most basic ways operating systems can differ is in
the extent to which they can support multiple concurrent processes. At
the lowest end (such as DOS or CP/M) the operating system is basically
a sequential program loader with no capacity to multitask at all.
Operating systems of this kind are no longer competitive on
general-purpose computers.
At the next level up, an operating system may have
cooperative multitasking. Such systems can
support multiple processes, but a process has to voluntarily give up
its hold on the processor before the next one can run (thus, simple
programming errors can readily freeze the machine). This style of
operating system was a transient adaptation to hardware that was
powerful enough for concurrency but lacked either a periodic clock
interrupt[21] or a memory-management unit or both; it,
too, is obsolete and no longer competitive.
Unix has preemptive multitasking, in
which timeslices are allocated by a scheduler which routinely
interrupts or pre-empts the running process in order to hand control
to the next one. Almost all modern operating systems support
preemption.
Note that “multitasking” is not the same as
“multiuser”. An operating system can be multitasking
but single-user, in which case the facility is used to support a
single console and multiple background processes. True multiuser
support requires multiple user privilege domains, a feature we'll
cover in the discussion of internal boundaries a bit further on.
To design the perfect anti-Unix, don't support multitasking at
all — or, support multitasking but cripple it by surrounding
process management with a lot of restrictions, limitations, and
special cases that mean it's quite difficult to get any actual use out
of multitasking.
[an error occurred while processing this directive]
|