order of computation is actually this

The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

+18 votes

Consider the $3$ processes, $P1, P2$ and $P3$ shown in the table.

Process |
Arrival time |
Time Units Required |
---|---|---|

$P1$ | $0$ | $5$ |

$P2$ | $1$ | $7$ |

$P3$ | $3$ | $4$ |

The completion order of the $3$ processes under the policies FCFS and RR2 (round robin scheduling with CPU quantum of $2$ time units) are

**FCFS**: $P1, P2, P3$**RR2**: $P1, P2, P3 $**FCFS**: $P1, P3, P2$**RR2**: $P1, P3, P2$**FCFS**: $P1, P2, P3$**RR2**: $P1, P3, P2$**FCFS**: $P1, P3, P2$**RR2**: $P1, P2, P3$

+25 votes

Best answer

**FCFS **First Come First Server

$P1$ | $P2$ | $P3$ |

**$\mathbf{0}$ $\mathbf{5}$ $\mathbf{12}$ $\mathbf{16}$**

**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

-- | -- | -- | $P1$ |

At $t=3$

- $P3$ arrives at ready queue

-- | -- | $P3$ | $P1$ |

At $t =4$

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

$p1$ | $p2$ | $p1$ | $p3$ | $p2$ | $p1$ | $p3$ | $p2$ |

**Option (C)** is correct

+14 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

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

+3

I'm not understanding how P3 finishes after P1.

P1 P2 P3 P1 P2 P3 P1 P2

0 2 4 6 8 10 12 14 16

is the sequence I'm getting.

P1 P2 P3 P1 P2 P3 P1 P2

0 2 4 6 8 10 12 14 16

is the sequence I'm getting.

- All categories
- General Aptitude 1.3k
- Engineering Mathematics 5.5k
- Digital Logic 2.1k
- Programming & DS 4k
- Algorithms 3.4k
- Theory of Computation 4.2k
- Compiler Design 1.6k
- Databases 3.1k
- CO & Architecture 2.7k
- Computer Networks 3.1k
- Non GATE 1.1k
- Others 1.4k
- Admissions 501
- Exam Queries 449
- Tier 1 Placement Questions 19
- Job Queries 62
- Projects 12

38,079 questions

45,571 answers

132,066 comments

49,040 users