<aside>
π‘
Summary of Section 4.1 - Principles of Scheduling
</aside>
Long-Term vs. Short-Term Scheduling
- Long-term scheduling controls when a process enters the ready list (RL) to compete for CPU time.
- Short-term scheduling determines which process from the ready list should execute next.
Processes can enter the ready list from:
- New processes list β Subject to long-term scheduling.
- Suspended list β Subject to long-term scheduling.
- Waiting list β Subject to short-term scheduling.
- CPU (after execution time expires) β Subject to short-term scheduling.
Preemptive vs. Non-Preemptive Scheduling
- Non-preemptive scheduling β Here the resource canβt be taken from a process until the process completes execution. The switching of resources occurs when the running process terminates and moves to a waiting state.
- Preemptive scheduling allows the OS to interrupt a process and switch to another when:
- A new process enters the ready list.
- A previously blocked/suspended process re-enters the ready list.
- The OS periodically interrupts a process to ensure fairness.
Priority in Short-Term Scheduling
- Priority values determine which process executes next.
- Priority can be static (fixed at creation) or dynamic (based on multiple factors).
Common factors affecting priority:
- Arrival time β When the process enters the ready list.
- Departure time β When the process exits due to blocking or termination.
- Attained CPU time β The CPU time used by a process since arrival.