JoeyBlades:
Please explain this concept… the rest of your explanation doesn’t make much sense to me without it.
Not necessarily. Each task has its own memory space, and therefore its own stack.
Also, the compiler doesn’t manage reentrancy, it only does enough to make recursive calls possible. It’s still simple to write a non-reentrant function.
I don’t see how the term reentrancy applies here… but I think, in general, it’s the driver’s job to ensure that the state remains the same. An application can open a wave output device, play a sound, and close the device, all without worrying about whether another application has interfered.
I don’t understand this part at all.
The most irritating example is that it doesn’t cede control while it’s laying out a page. With a complex page and a slow computer, this means that for several seconds or even a few minutes, the computer is completely unresponsive (even if Netscape is running in the background). The mouse moves and cmd-opt-esc works, but nothing else.
If I’m trying to browse the web and use IRC at the same time, usually this means that I’m out of the conversation for a few minutes, and I can’t even type a response to what I’ve already read. Some of my keystrokes do show up, so Netscape must be yielding occasionally, but not often enough. A line like “my flight comes in at 9:00” ends up looking like “myfg co n :00”.
I think this is one of the best reasons to use preemptive multitasking. With a complex task like this, where do you yield? After every HTML element, every 5 elements, every 10 elements? Too often and the task runs slowly; not often enough and the computer becomes unusable. “Too often” and “not often enough” change meaning depending on the computer’s speed and the size of the task. But if the OS manages task switching, everything runs smoothly and the programmer has one less thing to worry about.
Admitted.
Now, I suspect that the reason it didn’t work was Apple’s unfamiliarity with preemptive multitasking, not any inherent flaws in the concept.