Question
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?
Official answer and solution
- Official answer
- A
- From
- Official GATE 2025 answer key
Solution
Simulate the two-processor non-preemptive schedule starting from when all four processes arrive.
All four processes arrive at with bursts , , , :
- At :
- On , has the highest priority, so is scheduled on for . Waiting time .
- On , has the highest priority, so is scheduled on for . Waiting time .
- At :
- finishes and becomes free. The waiting processes are .
- On , , so is scheduled on for . Waiting time .
- At :
- finishes and becomes free. The only waiting process is .
- is scheduled on for . Waiting time .
Therefore, the average waiting time is:
Option (A)
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2025 Computer Science and Information Technology - Session 1 (CS1)
- Question
- 38 of 65
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.