Lably
Skip to content

Cooperative multitasking

Computer multitasking that does not preempt processes

  • 2 min read
  • 2 chapters

Related on Lably

Through Operating system, Process (computing) and Microsoft Windows

In this scheme, the process scheduler of an operating system is known as a cooperative scheduler whose role is limited to starting the processes and letting them return control back to it voluntarily.

This is related to the asynchronous programming approach.

Usage

Although it is rarely used as the primary scheduling mechanism in modern operating systems, it is widely used in memory-constrained embedded systems and in specific applications such as CICS or the JES2 subsystem. Cooperative multitasking was the primary scheduling scheme for 16-bit applications employed by Microsoft Windows before Windows 95 and Windows NT, and by the classic Mac OS. Windows 9x used non-preemptive multitasking for 16-bit legacy applications, and the PowerPC Versions of Mac OS X prior to Leopard used it for classic applications. NetWare, which is a network-oriented operating system, used cooperative multitasking up to NetWare 6.5. Cooperative multitasking is still used on RISC OS systems.

Cooperative multitasking is similar to async/await in languages, such as JavaScript or Python, that feature a single-threaded event-loop in their runtime. This contrasts with cooperative multitasking in that await cannot be invoked from a non-async function, but only an async function, which is a kind of coroutine.

Cooperative multitasking allows much simpler implementation of applications because their execution is never unexpectedly interrupted by the process scheduler; for example, various functions inside the application do not need to be reentrant.

Sign in to keep reading

One more chapter is free with a Lably account.

More in Computing and communication