Skip to content
GATEiit

GATE CSE 2019 Q51: Unknown burst time from average waiting time under SRTF

Syllabus topic: CPU and I/O scheduling

Question

Consider the following four processes with arrival times (in milliseconds) and their length of CPU bursts (in milliseconds) as shown below:

ProcessP1P2P3P4
Arrival time0134
CPU burst time313Z

These processes are run on a single processor using preemptive Shortest Remaining Time First scheduling algorithm. If the average waiting time of the processes is 1 millisecond, then the value of Z is ________.

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 2 (official GATE 2019 final answer key)

Concept used: Under preemptive SRTF the process with the least remaining time always runs; waiting time = completion time − arrival time − burst time, and the total waiting time here must be 4×1=4 ms.

Concept notes

Loading notes…

First step: Draw the Gantt chart up to time 4 (P1, P2, P1 are fixed), note the waiting time already built up, then try small values of Z for P4 against P3's remaining 3 ms until the total waiting time is 4 ms.

Full step-by-step solution

Loading…

Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.

More questions on CPU and I/O scheduling

Every PYQ on this topic →

Share this question

WhatsAppDownload image

Source: official GATE 2019 CS question paper and final answer key, organised by IIT Madras. Question paper · Answer key