→Related concepts: That's... not how you link to other Wikipedia articles; you are supposed to use Wikilinks, not external links. Link to the same pages we link to below.
Scheduling can be done at the kernel level or user level, and multitasking can be done [[PreemptivePreemption scheduling(computing)|preemptively]] or [[Cooperative multitasking|cooperatively]]. This yields a variety of related concepts.
===Processes===
Line 59:
==Scheduling==
===Preemptive vs cooperative scheduling===
Operating systems schedule threads either [[PreemptivePreemption scheduling(computing)|preemptively]] or [[Cooperative multitasking|cooperatively]]. [[Operating system#Single- and multi-user| Multi-user operating systems]] generally favor [[preemptive multithreading]] for its finer-grained control over execution time via [[context switch]]ing. However, preemptive scheduling may context-switch threads at moments unanticipated by programmers, thus causing [[lock convoy]], [[priority inversion]], or other side-effects. In contrast, [[cooperative multithreading]] relies on threads to relinquish control of execution, thus ensuring that threads [[Run to completion scheduling |run to completion]]. This can cause problems if a cooperatively multitasked thread [[Blocking (computing) |blocks]] by waiting on a [[Resource (computer science)| resource]] or if it [[Starvation (computer science) |starves]] other threads by not yielding control of execution during intensive computation.