Scheduling in operating systems refers to the method by which the system decides which process will use the CPU next. Since multiple processes may be ready to run at the same time, the scheduler manages the execution order to ensure efficient CPU usage, fairness among processes, and responsiveness.

The main goal of scheduling is to maximize CPU utilization and system performance. There are different types of scheduling algorithms, such as First-Come, First-Served (FCFS), Shortest Job Next (SJN), Round Robin (RR), and Priority Scheduling, each suited to different types of workloads and system goals. The scheduler selects a process from the ready queue and assigns the CPU to it, often involving context switching when moving between processes.

Scheduling Problem

  • Have process competing for resources (e.g., CPU, disk other devices)
  • Important OS function : define a schedule to manage access of process to these resources
  • Typically done by having queues of process waiting for a specific resource and selecting a process in the queue

Process Scheduling Queues

  • Job Queue - set of all processes in the system.
  • Ready Queue - set of all processes residing in main memory, ready and waiting to execute.
  • Device queues - set of processes waiting for an I/O device.
  • Process migrate among the various queues.