Jump to content

Cooperative multitasking: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Undid revision 505695405 by Keshavjoshi123 (talk) Reverted vandalism
→‎top: Briefly described the benefits of non-preemptive multitasking
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Unreferenced|date=December 2009}}
{{Use mdy dates|date=August 2015}}
'''Nonpreemptive multitasking''' is a style of [[computer multitasking]] in which the operating system never initiates a [[context switch]] from a running [[Process (computing)|process]] to another process. Such systems are either statically [[Scheduling (computing)|scheduled]], most often periodic systems, or exhibit some form of [[Co-operative multitasking|cooperative multitasking]], in which case the computational tasks can self-interrupt and voluntarily give control to other tasks.
When non preemptive is used, a process that receives such resources can not be interrupted until it is finished.


Cooperative multitasking is a type of multitasking in which the process currently controlling the CPU must offer control to other processes. It is called “cooperative” because all programs must cooperate for it to work. In contrast, preemptive multitasking interrupts applications and gives control to other processes outside of an application's control.
'''Non-preemptive multitasking''' or '''cooperative multitasking''' is a style of [[computer multitasking]] in which the [[operating system]] never initiates a [[context switch]] from a running [[Process (computing)|process]] to another process. Instead, processes voluntarily stop their operation periodically in order to enable multiple applications to be run simultaneously. This type of miultitasking is called "cooperative" because all programs must cooperate for the entire scheduling scheme to work. In this scheme, the [[process scheduler]] of an operating system is known as '''cooperative scheduler''', having its role reduced down to starting the processes and letting them return control back to it voluntarily.<ref name="pcmag">{{cite web
| url = http://www.pcmag.com/encyclopedia/term/48051/non-preemptive-multitasking
| title = Definition of non-preemptive multitasking
| accessdate = {{date|2015-08-15|mdy}}
| website = pcmag.com
}}</ref><ref name="classiccmp">{{cite web
| url = http://www.classiccmp.org/cini/pdf/HT68K/HT68K%20TCJ30p37.pdf
| title = Non-Preemptive Multitasking
| date = {{date|2011-11-05|mdy}} | accessdate = {{date|2015-08-15|mdy}}
| author = Joe Bartel | website = classiccmp.org
}}</ref>


Although it is rarely used in modern larger systems except for specific applications such as [[CICS]] or the [[JES2]] subsystem, non-preemptive multitasking was once the scheduling scheme employed by [[Microsoft Windows]] (prior to [[Windows&nbsp;95]] and [[Windows&nbsp;NT]]) and [[Mac&nbsp;OS]] (prior to [[OS&nbsp;X]]). [[Windows&nbsp;9x]] also used non-preemptive multitasking, but only for 16-bit legacy applications, much the same way as the [[PowerPC]] versions of Mac OS&nbsp;X prior to [[Mac OS X v10.5|Leopard]] used it for [[Classic (Mac OS X)|classic]] applications.<ref name="pcmag" /> The network operating system [[NetWare]] used non-preemptive multitasking up to NetWare&nbsp;6.5. Non-preemptive multitasking is still used on [[RISC&nbsp;OS]] systems.<ref>{{cite web
==See also==
| url = http://www.riscos.info/index.php/Preemptive_multitasking
*[[Scheduling (computing)|Scheduling]]
| title = Preemptive multitasking
*[[Preemption (computing)|Preemption]]
| date = {{date|2009-11-02|mdy}} | accessdate = {{date|2015-08-15|mdy}}
| website = riscos.info
}}</ref>

As a non-preemptively multitasked system relies on each process regularly giving up time to other processes on the system, one poorly designed program can consume all of the CPU time for itself, either by performing extensive calculations or by [[busy wait]]ing; both would cause the whole system to [[hang (computing)|hang]]. In a [[Server (computing)|server]] environment, this is a hazard that makes the entire environment unacceptably fragile.<ref name="pcmag" /> However, non-preemptive multitasking allows much simpler implementation of applications because their execution is never unexpectedly interrupted by the process scheduled; for example, various [[Subroutine|functions]] inside the application do not need to be [[Reentrancy (computing)|reentrant]].<ref name="classiccmp" />

In contrast, [[Preemption (computing)|preemptive]] multitasking interrupts applications and gives control to other processes outside of the application's control.

== References ==
{{Reflist}}


{{DEFAULTSORT:Nonpreemptive Multitasking}}
{{DEFAULTSORT:Nonpreemptive Multitasking}}

Revision as of 13:18, 15 August 2015

Non-preemptive multitasking or cooperative multitasking is a style of computer multitasking in which the operating system never initiates a context switch from a running process to another process. Instead, processes voluntarily stop their operation periodically in order to enable multiple applications to be run simultaneously. This type of miultitasking is called "cooperative" because all programs must cooperate for the entire scheduling scheme to work. In this scheme, the process scheduler of an operating system is known as cooperative scheduler, having its role reduced down to starting the processes and letting them return control back to it voluntarily.[1][2]

Although it is rarely used in modern larger systems except for specific applications such as CICS or the JES2 subsystem, non-preemptive multitasking was once the scheduling scheme employed by Microsoft Windows (prior to Windows 95 and Windows NT) and Mac OS (prior to OS X). Windows 9x also used non-preemptive multitasking, but only for 16-bit legacy applications, much the same way as the PowerPC versions of Mac OS X prior to Leopard used it for classic applications.[1] The network operating system NetWare used non-preemptive multitasking up to NetWare 6.5. Non-preemptive multitasking is still used on RISC OS systems.[3]

As a non-preemptively multitasked system relies on each process regularly giving up time to other processes on the system, one poorly designed program can consume all of the CPU time for itself, either by performing extensive calculations or by busy waiting; both would cause the whole system to hang. In a server environment, this is a hazard that makes the entire environment unacceptably fragile.[1] However, non-preemptive multitasking allows much simpler implementation of applications because their execution is never unexpectedly interrupted by the process scheduled; for example, various functions inside the application do not need to be reentrant.[2]

In contrast, preemptive multitasking interrupts applications and gives control to other processes outside of the application's control.

References

  1. ^ a b c "Definition of non-preemptive multitasking". pcmag.com. Retrieved August 15, 2015.
  2. ^ a b Joe Bartel (November 5, 2011). "Non-Preemptive Multitasking" (PDF). classiccmp.org. Retrieved August 15, 2015.
  3. ^ "Preemptive multitasking". riscos.info. November 2, 2009. Retrieved August 15, 2015.