edited by
32,851 views
78 78 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$

9 Answers

Best answer
72 72 votes

FCFS First Come First Server


RR2

In Round Robin We are using the concept called Ready Queue. 
 

Note
 at $t=2$ ,

  • $P1$ finishes and sent to Ready Queue
  • $P2$ arrives and schedules $P2$

This is the Ready Queue


At $t=3$

  • $P3$ arrives at ready queue

At $t =4$

  • $P1$ is scheduled as it is the first process to arrive at Ready Queue


Option (C) is correct

edited by
21 21 votes
FCFS :- First come first serve.

Here arrival times of all processes are different, So for completion time just order them according of their arrival time. We get P1,P2,P3. So this eliminates option B & D.

Round Robin - Here when you run round robin algorithm on this 3 processes. completion sequence is P1, P3, P2.As Burst Time for P2 is big, P3 completes before P2.

 

So answer is (C)

Referemce :-

https://en.wikipedia.org/wiki/Round-robin_scheduling

https://en.wikibooks.org/wiki/Operating_System_Design/Scheduling_Processes/FCFS
5 5 votes
option C  is correct  here FCFS is completion order               P1   P2   P3

                                                                                       0    5      12     16

 and RR scheduling    P1   P2   P1   P3   P2   P1   P3    P2

                             0     2      4     6      8     10   11     13     16

  ready queue -  P1,P2,P1,P3 ,P2,P1,P3,P2

           completion order P1, P3 ,P2  hence optionC is correct
edited by
4 4 votes

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

1 1 vote

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:
Position:
Show:

Related questions

36 36 votes
4 answers 4 answers
16.6k
16.6k views
Arjun asked Sep 29, 2014
16,635 views
Consider the virtual page reference string$$\text{1, 2, 3, 2, 4, 1, 3, 2, 4, 1}$$on a demand paged virtual memory system running on a computer system that has main memory...
65 65 votes
3 answers 3 answers
31.2k
31.2k views
Arjun asked Sep 29, 2014
31,195 views
A file system with $300$ GByte disk uses a file descriptor with $8$ direct block addresses, $1$ indirect block address and $1$ doubly indirect block address. The size of ...
173 173 votes
15 answers 15 answers
49.7k
49.7k views
gatecse asked Sep 26, 2014
49,686 views
Fetch_And_Add(X,i) is an atomic Read-Modify-Write instruction that reads the value of memory location $X$, increments it by the value $i$, and returns the old value of $X...
66 66 votes
7 answers 7 answers
17.6k
17.6k views
go_editor asked Apr 21, 2016
17,617 views
Consider the following C code segment.int a, b, c = 0; void prtFun(void); main() { static int a = 1; /* Line 1 */ prtFun(); a += 1; prtFun(); printf(“ \n %d %d ”, a, b); ...