11,076 views
11 votes
11 votes

Suppose two jobs, each of which needs $10$ minutes of CPU time, start simultaneously. Assume $50\%$ I/O wait time. How long will it take for both to complete, if they run sequentially?

  1. 10
  2. 20
  3. 30
  4. 40

10 Answers

0 votes
0 votes

Ans is B

Since order of cpu and i/o is not mentioned in the question .so we shall arrange the process in the following order:

Process        Arr-Time     CPU Time               I/O Time      CPU Time

P1                 0               5                                5              5

P2                 0               5                                5              5

Now the Gantt chart:

0                             5       P1 I/0               10   P2 I/O              1 5                        20

p1 p2 p1 p2

So it will take Total time=20 min

0 votes
0 votes

This is a really confusing question but I am sure this explanation will clarify it.

A job can be broken into two parts: 50% I/O and 50% CPU

Let x be the total time a job takes in CPU.

We are given only the time it takes in CPU and not the time the whole job takes. Hence we can say

x * 50% = 5min

Total time taken by job * (50% CPU Utilization) = 5min of CPU time

x = 5min/0.5 = 10min

Hence total time a job takes is 10min I/O and 10min CPU.

Total time = 20minutes.

If two process come sequentially then 20min + 20min = 40min.

Now you can try Q2 of this Assignment to clarify properly
https://www.studocu.com/en-us/document/texas-tech-university/operating-systems/assignments/written-assignment-2-solution/855040/view

Answer:

Related questions

13 votes
13 votes
2 answers
1
go_editor asked Jun 19, 2016
10,021 views
Suppose a system contains $n$ processes and system uses the round-robin algorithm for CPU scheduling then which data structure is best suited ready queue of the processst...
7 votes
7 votes
2 answers
2
go_editor asked Jun 19, 2016
3,819 views
Consider the following program.main() { fork(); fork(); fork(); }How many new processes will be created?8675
12 votes
12 votes
4 answers
3
go_editor asked Jun 17, 2016
3,821 views
In a lottery scheduler with 40 tickets, how we will distribute the tickets among 4 processes $P_1, P_2, P_3$ and $P_4$ such that each process gets 10%, 5%, 60% and 25% re...
6 votes
6 votes
2 answers
4
go_editor asked Jun 17, 2016
10,798 views
If there are 32 segments, each size 1 k bytes, then the logical address should have13 bits14 bits15 bits16 bits