cooperative multitasking


cooperative multitasking

[kō‚äp·rəd·iv ′məl·tə‚task·iŋ] (computer science) A method of running more than one program on a computer at a time in which the program currently in control of the processor retains the control until it yields the control to another program voluntarily, which it can do only at certain points in the program. Also known as nonpreemptive multitasking.

cooperative multitasking

(parallel, operating system)A form of multitasking where itis the responsibility of the currently running task to give upthe processor to allow other tasks to run. This contrastswith pre-emptive multitasking where the task schedulerperiodically suspends the running task and restarts another.

Cooperative multitasking requires the programmer to placecalls at suitable points in his code to allow his task to bedescheduled which is not always easy if there is no obvioustop-level main loop or some routines run for a long time.If a task does not allow itself to be descheduled all othertasks on the system will appear to "freeze" and will notrespond to user action.

The advantage of cooperative multitasking is that theprogrammer knows where the program will be descheduled and canmake sure that this will not cause unwanted interaction withother processes. Under pre-emptive multitasking, thescheduler must ensure that sufficient state for each processis saved and restored that they will not interfere. Thuscooperative multitasking can have lower overheads thanpre-emptive multitasking because of the greater control itoffers over when a task may be descheduled.

Cooperative multitasking is used in RISC OS, Microsoft Windows and Macintosh System 7.