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 21–25 of 37
A scheduling algorithm assigns priority proportional to the waiting time of a process. Every process starts with priority zero (the lowest priority). The scheduler re-evaluates the process priorities every T time units and decides the next process to schedule. Which one of the following is TRUE if the processes have no I/O operations and all arrive at time zero?
Answer: (B)
The process that has waited the longest gets the highest priority. Once it has run for T units, its waiting time (its priority) starts again from zero, so it moves to the back of the line. The processes then run one after another in a cycle, just like round robin.
Answer: This algorithm is equivalent to the round-robin algorithm
Answer: This algorithm is equivalent to the round-robin algorithm
Consider the 3 processes, P1, P2 and P3 shown in the table.
The completion order of the 3 processes under the policies FCFS and RR2 (round robin scheduling with CPU quantum of 2 time units) are
The completion order of the 3 processes under the policies FCFS and RR2 (round robin scheduling with CPU quantum of 2 time units) are
Answer: (C)
FCFS: The run order is P1 from 0-5, P2 from 5-12, then P3 from 12-16. Completion order: P1, P2, P3
RR2: The run order is P1 0-2, P2 2-4, P1 4-6, P3 6-8, P2 8-10, P1 10-11 (done), P3 11-13 (done), P2 13-16 (done). Completion order: P1, P3, P2
Answer: FCFS: P1, P2, P3; RR2: P1, P3, P2
RR2: The run order is P1 0-2, P2 2-4, P1 4-6, P3 6-8, P2 8-10, P1 10-11 (done), P3 11-13 (done), P2 13-16 (done). Completion order: P1, P3, P2
Answer: FCFS: P1, P2, P3; RR2: P1, P3, P2
Consider the following table of arrival time and burst time for three processes P0, P1 and P2.
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried out only at arrival or completion of processes. What is the average waiting time for the three processes?
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried out only at arrival or completion of processes. What is the average waiting time for the three processes?
Answer: (A)
Waiting time = completion time arrival time burst time. Preemptive SJF picks the process with the least remaining time, but only when a process arrives or finishes.
- 0-1: P0 runs (8 ms left).
- t = 1: P1 arrives with 4, less than P0's 8, so P1 preempts and runs 1-5.
- t = 2: P2 arrives with 9, more than P1's remaining 3, so there is no preemption.
- t = 5: P1 is done. P0 (8) is shorter than P2 (9), so P0 runs 5-13.
- 13-22: P2 runs.
Waiting times:
P0 = 13 0 9 = 4
P1 = 5 1 4 = 0
P2 = 22 2 9 = 11
Average = (4 + 0 + 11) / 3 = 5 ms
Answer: (A)
- 0-1: P0 runs (8 ms left).
- t = 1: P1 arrives with 4, less than P0's 8, so P1 preempts and runs 1-5.
- t = 2: P2 arrives with 9, more than P1's remaining 3, so there is no preemption.
- t = 5: P1 is done. P0 (8) is shorter than P2 (9), so P0 runs 5-13.
- 13-22: P2 runs.
Waiting times:
P0 = 13 0 9 = 4
P1 = 5 1 4 = 0
P2 = 22 2 9 = 11
Average = (4 + 0 + 11) / 3 = 5 ms
Answer: (A)
Which of the following statements are true?
I. Shortest remaining time first scheduling may cause starvation
II. Preemptive scheduling may cause starvation
III. Round robin is better than FCFS in terms of response time
I. Shortest remaining time first scheduling may cause starvation
II. Preemptive scheduling may cause starvation
III. Round robin is better than FCFS in terms of response time
Answer: (D)
Let us check every statement:
- I: If short jobs keep coming, long jobs may have to wait forever True
- II: In preemptive priority scheduling, low-priority processes can starve True
- III: RR lets each process get the CPU soon, so its response time is better than FCFS True
Answer: I, II and III
- I: If short jobs keep coming, long jobs may have to wait forever True
- II: In preemptive priority scheduling, low-priority processes can starve True
- III: RR lets each process get the CPU soon, so its response time is better than FCFS True
Answer: I, II and III
If the time-slice used in the round-robin scheduling policy is more than the maximum time required to execute any process, then the policy will
Answer: (C)
Answer is (C).
Round robin works like FCFS, but each process runs only for one time slice at a time. If the time slice is larger than the maximum time any process needs, every process finishes in the first cycle itself. So the policy simply becomes FCFS.
Keep practising
Topics in Operating System
System CallProcessThreadProcess SynchronizationDeadlock
CPU SchedulingYou are here
Disk SchedulingMemory ManagementFile Systems