First Come First Serve(FCFS) & Round Robin Scheduling - Example - Operating System

Q.  In the given table it shows P1, P2 and P3 are the three processes.
What is the completion order of the 3 processes under the policies First Come First Serve(FCFS) and Round Robin Scheduling? (RRS with CPU quantum time of 2 units)

- Published on 25 Aug 15
computer-science-22.png


a. FCFS: P1, P2, P3 RR2: P1, P3, P2
b. FCFS: P1, P3, P2 RR2: P1, P2, P3
c. FCFS: P1, P3, P2 RR2: P1, P3, P2
d. FCFS: P1, P2, P3 RR2: P1, P2, P3

ANSWER: FCFS: P1, P2, P3 RR2: P1, P3, P2
 

    Discussion

  • Nirja Shah   -Posted on 23 Nov 15
    FCFS is clear.

    In RR, time slot is of 2 units.

    Processes are assigned in following order
    p1, p2, p1, p3, p2, p1, p3, p2, p2

    - It involves the concept of ready queue.

    - At t=2, p2 starts and p1 is sent to the ready queue and at t=3 p3 arrives, then the job p3 is queued in ready queue after p1.

    - At t=4, again p1 is executed then p3 is executed for first time at t=6.

Post your comment / Share knowledge


Enter the code shown above:
 
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)