How and when a process is swapped in and out of the CPU, thus enabling multi-tasking
Three states
- Running
- Ready to run
- Blocked
Process
- Processing is controlled by a scheduler
- Currently active programs held in the READY QUEUE
- Each program allocated a time slice (amount of time that it will spend in the CPU) when it reaches the front of the RUNNING QUEUE
- If time slice exceeded, moved to the back of the process/ready queue
- If I/O required whilst in the CPU, the task is temporarily moved into the blocked queue
Polling
- OS periodically checks the progress of jobs suspended in the spooling system/availability of I/O devices
- Allows jobs to re-join the runnable queue when I/O is completed
Within the processor queue, you have a main and fast queue for larger and smaller amount of tasks (think of the quick checkouts for people with few items at supermarkets).
Threading
<aside>
👉 When a process is split up into smaller processes known as threads which can be executed separately across multiple cores in the CPU
</aside>