# GATE2014-2-32

4.3k 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:

$$\begin{array}{|c|c|c|} \hline \textbf{Process id} & \textbf{t_c} & \textbf{t_{io}} \\\hline \textbf{A} & \text{100 ms} & \text{500 ms} \\\hline \textbf{B} & \text{350 ms} & \text{500 ms}\\\hline \textbf{C} & \text{200 ms} & \text{500 ms} \\\hline \end{array}$$

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
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
11
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?
6
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?
0
LOL, hard to complete the Paper , if we solve this Fully. Definitely its EASY , but too Time Consuming.

please check someone 0
correct
There are three processes A, B and C that run in
round robin manner with time slice of 50 ms.

Processes start 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

## Related questions

1
2.5k views
An operating system uses shortest remaining time first scheduling algorithm for pre-emptive scheduling of processes. Consider the following set of processes with their arrival times and CPU burst times (in milliseconds): ... The average waiting time (in milliseconds) of the processes is ______.
Consider the main memory system that consists of $8$ memory modules attached to the system bus, which is one word wide. When a write request is made, the bus is occupied for $100$ nanoseconds (ns) by the data, address, and control signals. During the same $100$ ns, ... be on the bus at any time. The maximum number of stores (of one word each) that can be initiated in $1$ millisecond is ________
A FAT (file allocation table) based file system is being used and the total overhead of each entry in the FAT is $4$ bytes in size. Given a $100 \times 10^6$ bytes disk on which the file system is stored and data block size is $10^3$ bytes, the maximum size of a file that can be stored on this disk in units of $10^6$ bytes is _________.