2.1k views

Three processes $A$, $B$ and $C$ each execute a loop of $100$ iterations. In each iteration of the loop, a process performs a single computation that requires $t_c$ CPU milliseconds and then initiates a single I/O operation that lasts for $t_{io}$ milliseconds. It is assumed that the computer where the processes execute has sufficient number of I/O devices and the OS of the computer assigns different I/O devices to each process. Also, the scheduling overhead of the OS is negligible. The processes have the following characteristics:

 Process id $t_c$ $t_{io}$ $A$ $100$ ms $500$ ms $B$ $350$ ms $500$ ms $C$ $200$ ms $500$ ms

The processes $A$, $B$, and $C$ are started at times $0$, $5$ and $10$ milliseconds respectively, in a pure time sharing system (round robin scheduling) that uses a time slice of $50$ milliseconds. The time in milliseconds at which process C would complete its first I/O operation is ___________.

edited | 2.1k views
0

each execute a loop of 100 iterations.

WHT DOES ITS MEAN?

0
Means each ABC do 100 iterations.Each iteration it does tc and tio

Gantt chart : $ABCABCBCBC$
$C$ completes it CPU burst at$= 500$ milli second.
IO time $= 500$ milli second
$C$ completes $1$st IO burst at $t = 500 + 500 = 1000$ms
edited by
+5
here are three processes A, B and C that run in
round robin manner with time slice of 50 ms.

Processes atart at 0, 5 and 10 miliseconds.

The processes are executed in below order
A, B, C, A
50 + 50 + 50 + 50 (200 ms passed)

Now A has completed 100 ms of computations and
goes for I/O now

B, C, B, C, B, C
50 + 50 + 50 + 50 + 50 + 50 (300 ms passed)

C goes for i/o at 500ms and it needs 500ms to
finish the IO.

So C would complete its first IO at 1000 ms

http://geeksquiz.com/gate-gate-cs-2014-set-2-question-42/

0
where are you accounting for 100 iterations?
+5
Question has asked for completion of first I/O so need not consider anything beyond it
0

It is given that a process initiates IO , so it could be the case that after initiating the IO it again starts with the next iterations, then instead of ABCABCBCBC , we would have ABCABCABCABC. So what is stopping A's next iteration from starting.

+1
After 100 ms of computation, process A has to perform I/O for 500 ms for completing the 1st iteration. Only after completing 1st iteration can process A start 2nd iteration.
0
Maybe, but then it is mentioned that there are sufficient IO devices, I think it refers to the buffering ability of the devices, so that requests can be buffered.
0
What if input of 1st iteration of A is used in computation of 2nd iteration of A? Then buffering won't help since you've got to take input before processing it.
0

There are sufficient I/O devices implies that we can overlap I/O of the processes I.e I/O of processes a,b and c can be done simultaneously. If sufficient I/O devices weren't available, then maybe for example process C has to wait for process B's I/O to complete. A similar question:

https://gateoverflow.in/1843/gate2006-65

0
After 1st CPU burst of C why it doesnt go for IO operation ie after 150ms.?
0
Why didn't the second iteration of A start? I believe the second iteration of A (A2) needn't wait for IO of previous A (A1)
0

In each iteration of the loop, a process performs a single computation that requires tc CPU milliseconds and then initiates a single I/O operation that lasts for tio milliseconds.

A is one process.Multiple process I/o can overlap but not one process.You can think A as:-

For i=1 to 100

{

Do CPU time;

DO I/o time

}

0
@rahul sharma 5

So CPU can't start A (A2) again till previous A (A1) has finished?
+1 vote

0
correct

1
2