1. Basic Concepts of CPU Scheduling
CPU scheduling is used when many processes are ready for execution but CPU can execute only one process at a time. The operating system selects one process from the ready queue and gives CPU to it.
This unit explains how an Operating System selects processes for CPU execution, manages process operations, supports threads, enables communication between processes, and controls shared resources using critical section rules and semaphores.
All topics are arranged according to the RGPV IT501 Operating System Unit 2 syllabus.
CPU scheduling is used when many processes are ready for execution but CPU can execute only one process at a time. The operating system selects one process from the ready queue and gives CPU to it.
Scheduling criteria are used to judge whether a scheduling algorithm is good or not.
| Criteria | Meaning | Goal |
|---|---|---|
| CPU Utilization | How much CPU remains busy | Maximum |
| Throughput | Number of processes completed per unit time | Maximum |
| Waiting Time | Time spent in ready queue | Minimum |
| Turnaround Time | Total time from submission to completion | Minimum |
| Response Time | Time taken to give first response | Minimum |
Scheduling algorithms define the rule used by the OS to select a process for CPU execution.
| Algorithm | Basic Idea | Type |
|---|---|---|
| FCFS | First arriving process gets CPU first. | Non-preemptive |
| SJF | Process with shortest CPU burst gets priority. | Both |
| Priority Scheduling | CPU is given according to priority value. | Both |
| Round Robin | Each process gets fixed time quantum. | Preemptive |
Algorithm evaluation means comparing scheduling algorithms using waiting time, turnaround time, response time, throughput and CPU utilization.
In exams, students are often asked to calculate average waiting time and average turnaround time for FCFS, SJF or Round Robin scheduling.
Multiple processor scheduling is used when a system has more than one CPU. The main challenge is to divide processes among processors fairly and efficiently.
A process is a program under execution. It contains program code, program counter, registers, stack, data section and process control block.
The operating system performs many operations on processes during execution.
A thread is a lightweight unit of execution inside a process. One process can contain multiple threads, and these threads share the same process resources.
Inter Process Communication allows different processes to exchange data and coordinate with each other.
| IPC Method | Meaning |
|---|---|
| Shared Memory | Processes communicate through common memory area. |
| Message Passing | Processes communicate by sending and receiving messages. |
A precedence graph shows the order in which processes or tasks must be executed. It is useful when one task depends on the completion of another task.
Critical section is the part of a program where shared data or shared resources are accessed. The problem is to ensure that only one process enters the critical section at one time.
Semaphore is a synchronization variable used to control access to shared resources. It is mainly used to solve critical section and synchronization problems.
| Semaphore Type | Description |
|---|---|
| Binary Semaphore | Value can be 0 or 1. It works like a lock. |
| Counting Semaphore | Value can be more than 1. It controls multiple resources. |
Classical synchronization problems are standard problems used to understand process synchronization.
Unit 2 is mostly asked through CPU scheduling numericals and synchronization-based theory questions.
CPU Scheduling Algorithms
β β β β βFCFS, SJF and Round Robin scheduling calculations.
95% ProbabilityCritical Section, Semaphores and Synchronization.
90% Probability| Topic | Question Style | Importance |
|---|---|---|
| CPU Scheduling | Numerical / Theory | β β β β β |
| Process Concept | Diagram / Explanation | β β β β β |
| Threads | Short Note | β β β ββ |
| Critical Section | Long Answer | β β β β β |
| Semaphores | Long Answer / Problem | β β β β β |