Instructor: Neerja Mhaskar
Course: COMP SCI 3SH3 – Operating Systems
Based on: Chapter 5 of the textbook Operating Systems Concepts
Overview
This chapter focuses on CPU Scheduling, an essential component of operating system design, responsible for managing the system's most critical resource: the CPU. Effective scheduling optimizes CPU utilization, turnaround time, waiting time, and overall system throughput.
1. Basic Concepts
- Resource Scheduling:
- The operating system schedules almost all resources in the system, but CPU scheduling is central to its design.
- Goal: Maximize CPU utilization since processes alternate between CPU usage and I/O waiting.
- Process Execution Cycle:
- A process alternates between CPU bursts (execution on the CPU) and I/O bursts (waiting for I/O).
- I/O-bound programs: Many short CPU bursts.
- CPU-bound programs: Few long CPU bursts.
- The balance of I/O-bound and CPU-bound processes is key in selecting the appropriate CPU scheduling algorithm.
2. Process Scheduling
- The operating system maintains several scheduling queues:
- Job queue: Contains all processes in the system.
- Ready queue: Holds processes that reside in memory and are ready to execute.
- Device queues: Contains processes waiting for I/O devices. Each device typically has its own queue.
- Process Scheduler: Selects processes from these queues based on the selected scheduling algorithm.
3. Ready Queue and I/O Device Queues
- Queues are a central part of the process scheduling system.
- A queueing diagram can be used to visually represent the movement of processes between these queues.
4. CPU Scheduler