9,132 views

Four jobs to be executed on a single processor system arrive at time $0$ in the order $A, B, C, D$. Their burst CPU time requirements are $4, 1, 8, 1$ time units respectively. The completion time of $A$ under round robin scheduling with time slice of one time unit is

1. $10$
2. $4$
3. $8$
4. $9$

If the question was chaged a little; The processes arrived at 5 instead of 0 secs. Then how would the asnwer change it it did?

Then it would be $9+5=14$ units.

The completion time of $A$ will be $9$ Unit.

Hence, option (D) is correct.

Here, is the sequence (Consider each block takes one time unit)

$$\begin{array}{|c|c|c|} \hline \textbf {A} &\textbf {B} & \textbf {C} & \textbf{D }& \textbf{A}& \textbf{C}& \textbf{A}& \textbf{C}& \textbf{A} \\\hline \end{array}$$

Completion time of $A$ will be $9$.

by

### 1 comment

Correct
here all process arrive at time 0.so there order of  execution will be A B C D, in this manner completion time for A is 9

A B C D A C A C A
will be the sequence of processes getting executed. B and D finishes after 1 time slot.

edited

A | B | C | D | A | C | A | C | A

0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |

sir, completion time of A will be 8. because completion time is the time where any process end own execution at the end time unit. in example process A end his execution at the end of time unit 8. am i correct?

@rajesh jaiswal

No you are wrong.

in this question they start from 0 and time slice / time quantum is 1 . This is Round robin.

The sequence of process  A B C D A C A C A based on their burst time ( with each CPU time needed 4,1,8,1 for A B C D respectively.
Burst Time: Time required by a process for CPU execution.).
this sequence is based on their burst time.


Now Completion Time means Time at which process completes its execution.

So according to sequence there are 9 elements in the sequence and each takes 1 time unit (swap and again come because of RR ) and total completion time is 9. Finally at time 9 process A completes it's execution .

hence answer is 9 , option D.

Reference:

http://quiz.geeksforgeeks.org/gate-notes-operating-system-process-scheduling/