GATE | GATE-CS-2014-(Set-2) | Question 42
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 tc CPU milliseconds and then initiates a single I/O operation that lasts for tio 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 tc tio
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 ___________.
(A)
500
(B)
1000
(C)
2000
(D)
10000
Answer: (B)
Explanation:
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 milliseconds.
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
Quiz of this Question
Please comment below if you find anything wrong in the above post
Last Updated :
06 Sep, 2021
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...