Computer Science – 16.1 Purposes of an Operating System (OS) | e-Consult
16.1 Purposes of an Operating System (OS) (1 questions)
Priority scheduling assigns a priority value to each process, and the process with the highest priority is executed first. The OS maintains a priority queue of ready processes. The scheduler selects the highest-priority process from the queue to run. If a higher-priority process becomes ready while a lower-priority process is running, the current process is preempted and the higher-priority process takes over.
Here's a table illustrating how priority affects execution:
| Process Name | Priority (Lower is Higher) | Execution Status |
| Process A | 1 | Running |
| Process B | 3 | Ready |
| Process C | 5 | Blocked (Waiting for I/O) |
Explanation: Process A, with the highest priority (lowest number), is currently running. Process B is ready to run but is waiting for Process A to finish. Process C is blocked and will not be considered for execution until it is unblocked. The scheduler will ensure that Process A gets to run as soon as possible, unless a higher-priority process becomes ready.