CPU Scheduling · Operating System
37 questions · asked in 24 of 27 years (2000–2026)
MCQ 24 · MSQ 2 · NAT 111-mark 21 · 2-mark 16
2000Questions per year2026
Questions 1–5 of 37
Consider a CPU that has to execute two types of processes. The first type, Actuators (A), requires a CPU burst of seconds. The second type, Controllers (C), requires a CPU burst of seconds. A new process of type A arrives at time , , and (in seconds). Similarly, a new process of type C arrives at time , and (in seconds). The CPU scheduling policy is First Come First Serve (FCFS). The first process of type A starts running at seconds. The average waiting time (in seconds) for the processes is ________. (rounded off to one decimal place)
Answer: 9.5
Write down all processes in the order they arrive. Then run FCFS on them. The CPU serves processes strictly in arrival order and does not preempt.
Add up the waiting times: .
The average waiting time seconds.
Answer: 9.5
Add up the waiting times: .
The average waiting time seconds.
Answer: 9.5
Which one of the following CPU scheduling algorithms cannot be preemptive?
Answer: (B)
Let us check each algorithm to see if it can be preemptive:
- SRTF is the preemptive form of Shortest-Job-First. It can stop the running process when a new process arrives with a shorter remaining time.
- Round Robin is preemptive by nature. When the time quantum of a running process ends, the process is forced off the CPU.
- Priority Scheduling can be preemptive or non-preemptive. In the preemptive form, a new process with higher priority takes the CPU from the current one. So it can be preemptive.
- FCFS (First Come First Serve) runs each process to completion in the order of arrival. In FCFS, a process that arrives later has no way to interrupt the one that is running. By definition it is non-preemptive.
Answer: First Come First Serve (FCFS) Scheduling cannot be preemptive.
- SRTF is the preemptive form of Shortest-Job-First. It can stop the running process when a new process arrives with a shorter remaining time.
- Round Robin is preemptive by nature. When the time quantum of a running process ends, the process is forced off the CPU.
- Priority Scheduling can be preemptive or non-preemptive. In the preemptive form, a new process with higher priority takes the CPU from the current one. So it can be preemptive.
- FCFS (First Come First Serve) runs each process to completion in the order of arrival. In FCFS, a process that arrives later has no way to interrupt the one that is running. By definition it is non-preemptive.
Answer: First Come First Serve (FCFS) Scheduling cannot be preemptive.
A computer has two processors, and . Four processes with CPU bursts of 20, 16, 25, and 10 milliseconds, respectively, arrive at the same time and these are the only processes in the system. The scheduler uses non-preemptive priority scheduling, with priorities decided as follows:
uses priority of execution for the processes as, , i.e., and have highest and lowest priorities, respectively.
uses priority of execution for the processes as, , i.e., and have highest and lowest priorities, respectively.
A process is scheduled to a processor , if the processor is free and no other process is waiting with higher priority. At any given point of time, a process can be allocated to any one of the free processors without violating the execution priority rules. Ignore the context switch time. What will be the average waiting time of the processes in milliseconds?
uses priority of execution for the processes as, , i.e., and have highest and lowest priorities, respectively.
uses priority of execution for the processes as, , i.e., and have highest and lowest priorities, respectively.
A process is scheduled to a processor , if the processor is free and no other process is waiting with higher priority. At any given point of time, a process can be allocated to any one of the free processors without violating the execution priority rules. Ignore the context switch time. What will be the average waiting time of the processes in milliseconds?
Answer: (A)
All four processes arrive together at , and there are two free processors. So two processes start right away. is the top priority of , and is the top priority of . Each of these is also the lowest priority of the other machine, so there is no conflict. The natural start is and , both beginning at .
(burst ) ends first, at , and this frees . Among the waiting , the priority order of () prefers . So starts on at and runs until .
(burst ) ends next, at , and this frees . Only is still waiting, so it starts on at and runs until .
Waiting times: , , , .
Average: .
Answer: 9
(burst ) ends first, at , and this frees . Among the waiting , the priority order of () prefers . So starts on at and runs until .
(burst ) ends next, at , and this frees . Only is still waiting, so it starts on at and runs until .
Waiting times: , , , .
Average: .
Answer: 9
Processes arrive in that order at times 0, 1, 2, and 8 milliseconds respectively, and have execution times of 10, 13, 6, and 9 milliseconds respectively. Shortest Remaining Time First (SRTF) algorithm is used as the CPU scheduling policy. Ignore context switching times.
Which ONE of the following correctly gives the average turnaround time of the four processes in milliseconds?
Which ONE of the following correctly gives the average turnaround time of the four processes in milliseconds?
Answer: (D)
Simulate SRTF (at each moment, run the available process with the least remaining time):
At : only is present (remaining ), so it runs.
At : arrives (remaining ). The remaining time of () is still the shortest, so keeps running.
At : arrives (remaining ). Now compare (), () and (). The shortest is , so the CPU switches to .
runs without a break from to (no shorter process arrives in between). It finishes just as arrives. turnaround time .
At : arrives (remaining ). Compare (), () and (). is the shortest and runs to completion at . turnaround time .
At : compare () and (). runs to completion at . Turnaround time .
At : only is left. It runs to completion at . Turnaround time .
Average turnaround time
Answer: 19
At : only is present (remaining ), so it runs.
At : arrives (remaining ). The remaining time of () is still the shortest, so keeps running.
At : arrives (remaining ). Now compare (), () and (). The shortest is , so the CPU switches to .
runs without a break from to (no shorter process arrives in between). It finishes just as arrives. turnaround time .
At : arrives (remaining ). Compare (), () and (). is the shortest and runs to completion at . turnaround time .
At : compare () and (). runs to completion at . Turnaround time .
At : only is left. It runs to completion at . Turnaround time .
Average turnaround time
Answer: 19
Consider a single processor system with four processes A, B, C, and D, represented as given below, where for each process the first value is its arrival time, and the second value is its CPU burst time.
A (0, 10), B (2, 6), C (4, 3), and D (6, 7).
Which one of the following options gives the average waiting times when preemptive Shortest Remaining Time First (SRTF) and Non-Preemptive Shortest Job First (NP-SJF) CPU scheduling algorithms are applied to the processes?
A (0, 10), B (2, 6), C (4, 3), and D (6, 7).
Which one of the following options gives the average waiting times when preemptive Shortest Remaining Time First (SRTF) and Non-Preemptive Shortest Job First (NP-SJF) CPU scheduling algorithms are applied to the processes?
Answer: (B)
SRTF Gantt chart: A(0-2), B(2-4), C(4-7), B(7-11), D(11-18), A(18-26)
Waiting time is completion time arrival time burst time.
A = 26010 = 16, B = 1126 = 3, C = 743 = 0, D = 1867 = 5
Average waiting time
NP-SJF Gantt chart: A(0-10), C(10-13), B(13-19), D(19-26)
Waiting times: A = 0, C = 104 = 6, B = 132 = 11, D = 196 = 13
Average waiting time
Answer: SRTF = 6, NP-SJF = 7.5
Waiting time is completion time arrival time burst time.
A = 26010 = 16, B = 1126 = 3, C = 743 = 0, D = 1867 = 5
Average waiting time
NP-SJF Gantt chart: A(0-10), C(10-13), B(13-19), D(19-26)
Waiting times: A = 0, C = 104 = 6, B = 132 = 11, D = 196 = 13
Average waiting time
Answer: SRTF = 6, NP-SJF = 7.5
Keep practising
Topics in Operating System
System CallProcessThreadProcess SynchronizationDeadlock
CPU SchedulingYou are here
Disk SchedulingMemory ManagementFile Systems