2,294 views
2 votes
2 votes
Q1)
An OS contains 10 identical processes that were initiated at the same time. Each process contains 15 identical requests, and each request consumes 20msec of CPU time. A request is followed by an I/O operation that consumes 10 msec. The system consumes 2 msec in CPU scheduling. For time quantum of 20 msec , the response times of the first request of the last process is

 
A) 26 msec B) 220 msec C) 200 msec D) none

Q 2)
In the above problem , the scheduler length is
A) 3300 msec B) 3600 msec C) 6300 msec D) 6600 msec

2 Answers

Best answer
3 votes
3 votes

Take the last process -> it will get its first request processed after 10 schedules. Because after the first time quantum, the first process does an I/O operation (as it would have finished its request which also takes 20ms and hence CPU given to next process) and hence the second process gets its chance. Thus, after 9 time quantum, the final process gets its request served (assuming a previously given process is never given CPU time again until all other processes in wait are given). So, this means we need 10 schedules (including one at the beginning) and given in question that each scheduling takes 2ms. So, response time for the first request of the last process 

$= 9\times 20 ms + 10 \times 2$

$= 180 + 20 = 200 ms$.

 

(2) The scheduling goes like this:


P1 P2 P3 ... P10 P1 P2 P3 ... P10 .... P10 P1 P2 ... P10 (P1-P10 repeated 15 times)

After every time quantum and at the beginning we need 2ms for scheduling the next process. So, total scheduling length

$= (20ms + 2ms)\times 10 \times 15$

$=220 \times 15 = 3300 ms$

 

selected by
0 votes
0 votes
180 + 20 + 20(10th process will respond after 20ms) = 220

I m thinking like this, please suggest!

Related questions

185
views
1 answers
0 votes
arpit.jha asked Apr 26
185 views
Hi, All I have a question that in Process Scheduling topic most of the time we need to solve the problem using Gantt chart that's a bit time consuming . So I wanted to kn...
692
views
3 answers
0 votes
Chaitanya Kale asked Sep 22, 2022
692 views
If we are using non-preemptive CPU scheduling then can there be process state transition from running to ready state?
435
views
1 answers
1 votes
iarnav asked Jan 12, 2022
435 views
Does non preemptive CPU scheduling needs hardware support.kindly explain.
830
views
1 answers
2 votes
srestha asked Mar 11, 2019
830 views
Consider a system having $10$ IO bound jobs and $1$ CPU bound job.. If IO bound job issue an IO request once for every ms of CPU computation and that each IO request take...