For those who don't know:
Cooperative multitasking-
Tasks are written as coroutines
(Tasks will periodiodically return control to the multitasker)
Pre-emptive multitasking-
Tasks are written as if they were single tasks; they are written in a straightforward manner.
Multitasker periodically interrupts each task, saves its state, and revives another task and its state.
Personally I find Cooperative multitasking to my taste - it's faster (there is no need to save states), uses lesser space (for the same reason) and it's harder to program for ( ). In fact Win16 programming used Cooperative multitasking; it is the newer Win32 which uses pre-emptive multitasking.
In fact I think the reason a lot of people are jumping into the pre-emptive bandwagon is simply to show off that they can make an interrupt routine which saves the state fast enough for pre-emptive multitasking to be feasible.
Everyone knows, of course, that pre-emptive multitasking is better. One thing a pre-emptive multitasker has which a cooperative multitasker doesn't is ALMOST COMPLETE control of the system. So if a task crashes, a pre-emptive multitasker will be able to remove the task from the system, while a cooperative multitasker can't. Or does everyone know that...?
I don't.
The AT has a 286 processor and while fast, was not fast enough to do pre-emptive multitasking in a graphics environment. On the AT architecture, there is in fact a way for a cooperative multitasker to detect if a task has crashed. I invite you all to think of just what trick it is for a cooperative multitasker to succesfully detect a crashed program.
"Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
Cooperative multitasking-
Tasks are written as coroutines
(Tasks will periodiodically return control to the multitasker)
Pre-emptive multitasking-
Tasks are written as if they were single tasks; they are written in a straightforward manner.
Multitasker periodically interrupts each task, saves its state, and revives another task and its state.
Personally I find Cooperative multitasking to my taste - it's faster (there is no need to save states), uses lesser space (for the same reason) and it's harder to program for ( ). In fact Win16 programming used Cooperative multitasking; it is the newer Win32 which uses pre-emptive multitasking.
In fact I think the reason a lot of people are jumping into the pre-emptive bandwagon is simply to show off that they can make an interrupt routine which saves the state fast enough for pre-emptive multitasking to be feasible.
Everyone knows, of course, that pre-emptive multitasking is better. One thing a pre-emptive multitasker has which a cooperative multitasker doesn't is ALMOST COMPLETE control of the system. So if a task crashes, a pre-emptive multitasker will be able to remove the task from the system, while a cooperative multitasker can't. Or does everyone know that...?
I don't.
The AT has a 286 processor and while fast, was not fast enough to do pre-emptive multitasking in a graphics environment. On the AT architecture, there is in fact a way for a cooperative multitasker to detect if a task has crashed. I invite you all to think of just what trick it is for a cooperative multitasker to succesfully detect a crashed program.
"Information has a tendency to be free. Which means someone will always tell you something you don't want to know."