edited by
19,593 views
47 votes
47 votes

Consider the $3$ processes, $P1, P2$ and $P3$ shown in the table. $$\small \begin{array}{|c|c|c|} \hline \textbf{Process} & \textbf{Arrival Time} & \textbf{Time Units Required} \\\hline \text{P1} & 0 & 5\\\hline \text{P2} & 1 & 7 \\\hline \text{P3} & 3 & 4 \\\hline  \end{array}$$The completion order of the $3$ processes under the policies FCFS and RR$2$ (round robin scheduling with CPU quantum of $2$ time units) are

  1. FCFS: $P1, P2, P3$  RR2: $P1, P2, P3 $
  2. FCFS: $P1, P3, P2$  RR2: $P1, P3, P2$
  3. FCFS: $P1, P2, P3$  RR2: $P1, P3, P2$
  4. FCFS: $P1, P3, P2$  RR2: $P1, P2, P3$
edited by

6 Answers

3 votes
3 votes

You can  appy this method to solve every question related to round robin process 

1 votes
1 votes

You can go with the manual approach using the gantt chart.

But this actually a good question, and it utilizes the concept that has already been asked in one of the gate previous year questions.

We'll take a smarter approach.

So we have two schedulings, FCFS and RR with TQ=2.

Now, FCFS is very simple, arrange the processes in increasing order of arrival time and you get the answer.

FCFS: P1 P2 P3

So possible options are A and C

​​​Now, regarding RR, there is a concept that when the time slice of the RR is as large as the largest execution time of the set of processes, then it will behave same as FCFS.

So, if my time quantum was equal to 7(largest execution time in our set), then execution sequence of RR would have been same as FCFS.

So answer would have been A.

But, here our TQ=2, so definitely RR will not work same as FCFS so answer would be C, and cannot be A.

 

 

Answer:

Related questions

34 votes
34 votes
4 answers
4
gatecse asked Aug 5, 2014
12,955 views
A process executes the codefork(); fork(); fork();The total number of child processes created is$3$$4$$7$$8$