[plug] Book of "facts" re Linux

Craig Ringer craig at postnewspapers.com.au
Sat May 15 22:01:30 WST 2004


On Sat, 2004-05-15 at 21:43, Shayne O'Neill wrote:
> sure about that? my understanding was 95 was doing pre-empt and we only
> recently got that.

Linux has been using preemptive multitasking since day 0, AFAIK. I think
you may be thinking of _kernel_ preemption WRT to the recent Linux
enhancement. Essentially, now code can be preempted when the current
point of execution is in the kernel, where before (or w/o a preemptive
kernel) you can only preempt code when it's running in user space.

The Mac (pre OSX) is a good example of another form of multitasking.
MacOS 7 and up (maybe 6 with multifinder too but I don't think so) used
co-operative multitasking. An app has to explicitly relinquish the CPU
and hand control back to the OS. If it fails to do so, other tasks
(including the OS) simply don't run. This can easily cause lockups when
apps go into infinite loops, or simply hog the CPU exclusively for long
periods.

Another method is to not really multi-task at all, instead supporting
multiple processes but only having the current active process able to
use CPU resources. AFAIK this is how MacOS 6 worked, and maybe Win311 as
well. It's somewhat akin to using a single linux shell and having to
suspend processes with ^Z to switch to another process. The shell would
not support 'bg'.

Craig Ringer




More information about the plug mailing list