92 92 votes Consider three processes, all arriving at time zero, with total execution time of $10$, $20$ and $30$ units, respectively. Each process spends the first $20\%$ of execution time doing I/O, the next $70\%$ of time doing computation, and the last $10\%$ of time doing I/O again. The operating system uses a shortest remaining compute time first scheduling algorithm and schedules a new process either when the running process gets blocked on I/O or when the running process finishes its compute burst. Assume that all I/O operations can be overlapped as much as possible. For what percentage of time does the CPU remain idle?$0\%$$10.6\%$$30.0\%$$89.4\%$ Operating System gatecse-2006 operating-system process-scheduling normal + – Rucha Shelke 53.7k views answer comment Share Follow Print See all 6 Comments 6 6 Comments reply Show 3 previous comments Kush_Bhatt commented Aug 29, 2025 i edited by Kush_Bhatt Aug 29, 2025 reply Follow flag The operating system uses a shortest remaining compute time first scheduling algorithm and schedules a new process either when the running process gets blocked on I/O or when the running process finishes its compute burstHere it is mentioned SRTF but told that it will schedule a new process only when blocked by I/O or finishes its burst. If arrival time and burst time are given such that preemption is possible, should we apply preemption as in SRTF, or only in those two cases? 0 0 replyShare Rhino commented Dec 7, 2025 reply Follow flag @Kush_Bhatt I also have the same doubt. But in the video solution, @Sachin Mittal 1 sir considered standard SRTF Scheduling for variation of this problem:But if their is explicitly mentionioned:"schedules a new process either when the running process gets blocked on I/O or when the running process finishes its compute burst."we should stick with it? 1 1 replyShare justanotherguy commented May 1 reply Follow flag The percentages are appearing as \text{20%}. Pls look into this!!! 0 0 replyShare Please log in or register to add a comment.
Best answer 127 127 votes $$\text{CPU Idle time}=\frac{2+3}{47} \times 100 = 10.6383\%$$ Answer is option (B). amarVashishth answered Nov 17, 2015 • edited Jun 29, 2018 by kenzou amarVashishth comment Share Follow See all 21 Comments 21 21 Comments reply Show 18 previous comments Saif ur Rehman commented Jan 13, 2019 reply Follow flag And what if the I/O operations doesn't overlaps. 0 0 replyShare Tmajestical commented Dec 22, 2022 reply Follow flag @amarVashishth, at t=44, the CPU burst of process p3 is done, so why should CPU wait for p3 to complete its IO? Kindly clarify. 0 0 replyShare M._Varun_Reddy commented May 24, 2025 reply Follow flag forgot the last i/o 0 0 replyShare Please log in or register to add a comment.
34 34 votes Process TOTAL BURST TIME I/O TIME CPU TIME I/O TIME P1 10 (10*20/100)=2 (10*70/100)=7 (10*10/100)=1 P2 20 (20*20/100)=4 (20*70/100)=14 (20*10/100)=2 P3 30 (30*20/100)=6 (30*70/100)=21 (30*10/100)=3 GANTT CHART Idle P1 P2 P3 Idle 0 2 9 23 44 47 total time=47 idle time= 2+3=5 % of idle time= (5/47)*100=10.6% mohitbawankar answered Oct 23, 2017 mohitbawankar comment Share Follow 0 reply Please log in or register to add a comment.
11 11 votes Let three processes be p0, p1 and p2. Their execution time is 10, 20 and 30 respectively. p0 spends first 2 time units in I/O, 7 units of CPU time and finally 1 unit in I/O. p1 spends first 4 units in I/O, 14 units of CPU time and finally 2 units in I/O. p2 spends first 6 units in I/O, 21 units of CPU time and finally 3 units in I/O. idle p0 p1 p2 idle 0 2 9 23 44 47 Total time spent = 47 Idle time = 2 + 3 = 5 Percentage of idle time = (5/47)*100 = 10.6 % stuti1 answered Jun 14, 2016 stuti1 comment Share Follow 0 reply Please log in or register to add a comment.
10 10 votes Option "B" Prateek kumar answered Dec 28, 2017 Prateek kumar comment Share Follow 0 reply Please log in or register to add a comment.
7 7 votes Answer will be 10.6382 air1ankit answered Jan 6, 2018 air1ankit comment Share Follow See 1 comment 1 1 comment reply legend_of_cse commented Dec 3, 2024 reply Follow flag Good explanation 0 0 replyShare Please log in or register to add a comment.
2 2 votes $i/o$ $cpu$ $i/o$ 1 2 7 1 2 4 14 2 3 6 21 3 Assume that all I/O operations can be overlapped as much as possible. $\underbrace{0-2}$ $\underbrace{2-9}$ $\underbrace{9-23}$ $\underbrace{23-44}$ $\underbrace{44-47}$ $idle$ $p1$ $p2$ $p3$ $idle$ $\dfrac{5}{47}\times 100=10.6\%$ KUSHAGRA गुप्ता answered Feb 11, 2020 KUSHAGRA गुप्ता comment Share Follow 0 reply Please log in or register to add a comment.