Middle
What is cooperative and preemptive multitasking?
sobes.tech AI
Answer from AI
Cooperative multitasking: Each process voluntarily gives control to the operating system when it considers itself ready. If one process hangs, the entire system can stop.
Preemptive multitasking: The operating system uses a scheduler to forcibly interrupt process execution and allocate CPU time among processes. A hung process does not affect the operation of others.
Comparison:
| Feature | Cooperative multitasking | Preemptive multitasking |
|---|---|---|
| Control transfer | By the process | By the operating system |
| Reliability | Lower | Higher |
| Implementation complexity | Simpler | More complex |
| Example | Early versions of Windows | Modern OS (Linux, macOS, Windows) |