18,329 views
13 13 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

11 Answers

Best answer
31 31 votes

"50% I/O wait time." mean 50% of the time CPU is waiting for IO.

ie: if total CPU time is 2x, then x times its doing IO operation and other x time it is running the process.

Now, calculate how much time CPU is running the process, it is 10+10 mins.(take processes in any order).

ie, x=20 mins, so 2x=40mins.

selected by
24 24 votes
CPU TIME = 10 min, IO Time = 50% i.e. 50% for CPU & 50% for IO. (it is not 50% of CPU time, read question again)
IO time = CPU Time = 10ms

t=0 to 10ms,
A completes its CPU Burst.

t= 10 to 20,
B completes CPU & at same time A Complete its IO burst.

t=20 to 30,
B completes its IO.

Total time is 30ms.
edited by
6 6 votes
 

50% I/O wait time means that a process is not in execution(i.e. CPU is sitting idle) for 50% of the total time a process requires from CPU to complete itself(its execution). Thus CPU Utilization turns out to be //whereas 50% I/O time means it needs 50% of total execution time(10 minutes) to complete its I/O.

50%=50/100 = .5

thus the time needed to complete a process which requires 10 minute of CPU will be = CPU time required by process/CPU utilization=

10/CPU utilization= 10/0.5 = 20 minutes.

when two processes run sequentially(one after the other) then the total time required will be = 10/0.5 + 10/0.5 = 20+20=40 minutes (ANSWER)

in case of parallel execution we again find the CPU utilization.. since two processes are in parallel thus the formulae becomes-->

{1-(I/O time)^no. of processes in parallel execution} =1-(0.5)^2=1-.25=0.75 now the CPU utilization for 1 process will be 0.75/2=0.375 Therefore the time required will be = CPU time required by process/CPU utilization= 10/0.375=26.67 minutes.

Since the two processes are running in parallel thus the time required by 1 process will be the total time required by 2 process=26.67 minutes

2 2 votes
option c .
Total time of one process=cpu time + I/O time=10+5=15
Since they are executing sequencially. So total time 15+15=30
0 0 votes

here two jobs run sequentially...so second job complete after completion of first job...

let time taken by first job to complete execution=x..but here job remains in i/o 50% time...means it will remain in cpu only 50% time...now we have cpu time=10 min

or i can say 50% of x=10 min..,so time taken by first job to complete execution=20 min,similarly second job will also take 20 min

so total time should be 40 min......optionD..

0 0 votes
its 30
Answer:
Position:
Show:

Related questions

16 16 votes
2 answers 2 answers
13.8k
13.8k views
go_editor asked Jun 19, 2016
13,838 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 7 votes
2 answers 2 answers
5.6k
5.6k views
go_editor asked Jun 19, 2016
5,615 views
Consider the following program.main() { fork(); fork(); fork(); }How many new processes will be created?8675
13 13 votes
5 answers 5 answers
5.6k
5.6k views
go_editor asked Jun 17, 2016
5,620 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...
7 7 votes
2 answers 2 answers
13.1k
13.1k views
go_editor asked Jun 17, 2016
13,117 views
If there are 32 segments, each size 1 k bytes, then the logical address should have13 bits14 bits15 bits16 bits