Question

Solve by Round Robin Scheduling, Quantum = 3 (preemptive). Calculate the average waiting time: Process Arrival Time Execution
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Round Robin Scheduling Algorithm is a preemptive scheduling algo that loads a process into the CPU only for a given time quantum and after the specified quantum is over whethe the process has completed or not it preempts the CPU and loads the next process in waiting queque. This in simple language can be called a schedduling algorithm which assigns each process a fixed time slot in a cyclic manner.

Now as we can see that according to the arrival time of the processses our waiting queue would we formed as :

P0 (5), P1 (3), P2(8), P3(6) where P0 is going to be first to be loaded on CPU and P3 last.

First of all lets draw the Gantt Chart that will clear most of the things:

PO (2) P1 (0) P2 (5) P3 (3) PO (0) P2 (3) P3 (0) P2 (0)

So in Gantt Chart above I have used () parenthesis with process name just to tell you how much execution time for a process is left after it has run for the specified time Quantum on the CPU.

Now lets calculate waiting time of each process:

P0: Its execution time was 5. It was allocated CPU in the starting as it come so it didnt wait for a unit. But after running for 3 units it was preempted and for execution of remaining 2 units it has to wait for 12-3 = 9 units of time as shown in the Gantt Chart above. So P0 waited for a total of 9 units.

P1: P1 was available at 1 but allocated CPU at 3 so it has to wait for 2 units. Now as its execution time was 3 units so it gets completed in the allocated time quantum and thus P1 has to wait for a total of 2 units.

P2: P2 was available at 2 but CPU was allocated to it at 6 so here it has to wait for 4 units. Further as its execution time was 8 so to complete the remaining it has to wait for additional 14 - 9 = 5 and 20 -17 = 3 so total waiting time for P2 was 4+5+3 = 12 units.

P3: P3 was allocated CPU at 9 whereas it was waiting from 3 so it has to wait for 9-3 = 6 units. Further as it has the execution time of 6 units it has to wait additionally for 17-12 = 5 units so in total P3 waited for 6+5 = 11 units of time.

Now the Average Waiting Time is : (9 + 2 + 12 + 11)/4 = 34/4 = 8.5 units

If any doubt left do comment it out in the comments section....

Add a comment
Know the answer?
Add Answer to:
Solve by Round Robin Scheduling, Quantum = 3 (preemptive). Calculate the average waiting time: Process Arrival...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Part 2 Round Robin Scheduling Process Burst Time in Ms P1 4 P2 2 P3 1...

    Part 2 Round Robin Scheduling Process Burst Time in Ms P1 4 P2 2 P3 1 Calculate the average waiting time and turnaround time using round robin scheduling, where the time quantum q = 2 ms According to the Round Robin algorithm, the arrival of processes is shown in the following Gantt chart. P1 P2 P3 P1 P2 P3 P1 P2 P3 P1 0                 2                 4                  6                8                 10               12                14               15              16               18...

  • The question is this. there is nothing given [8 What is the waiting time of each...

    The question is this. there is nothing given [8 What is the waiting time of each process for each of the scheduling algorithms? Marks] Job Arrival Time Size (msec) P1 0 9 Priority 3 (Silver) 1 (Diamond) 3 (Silver) P2 3 P3 3 3 P4 6 5 4 (Bronze) 2 (Gold) P5 7 4 (a) First-Come-First-Served (FCFS) scheduling (b) Preemptive PRIORITY scheduling (c) Non-preemptive PRIORITY scheduling (d) Round Robin (RR) (quantum = 3) scheduling

  • 4. Consider a ready queue with four processes :- Process Arrival Time Burst Time (ms) P1...

    4. Consider a ready queue with four processes :- Process Arrival Time Burst Time (ms) P1 Priority P2 P3 P4 P5 For each of the following CPU scheduling algorithms, determine the turnaround and average waiting time for each of the process :- a. Shortest remaining Time First b. Shortest Job First C. Priority Scheduling (Both pre-emptive and non-preemptive) d. Round Robin (quantum is 1 ms)

  • Answer the following using the processes and their corresponding arrival time and burst time. These processes...

    Answer the following using the processes and their corresponding arrival time and burst time. These processes are being scheduled using a preemptive, round-robin scheduling algorithm with a time quantum of 2 units. PID Arrival Time Burst Time P1 0 4 P2 1 5 P3 2 3 P4 3 2 P5 4 6 1. Use a Gantt chart to represent the above processes (5 points) 2. Calculate the average waiting time for each process (5 points) 3. Calculate the completion time...

  • V. Round Robin and SJF comparison 6 Process Arrival Time CPU Burst Time P1 0 9...

    V. Round Robin and SJF comparison 6 Process Arrival Time CPU Burst Time P1 0 9 P2 4 4 P3 6 P4 For each of the following algorithms, draw a Gantt chart and calculate the average wait time and turn around time. 1. Round robin with quantum=1 time unit 2. Round-robin with quantum=3 time-units 3. SJF WI preemption (Shortest Remaining Time First), assume quantum=3 4. SJE Wlo preemption 5. ECES

  • (Algorithm Computation Question) Given the following processes and associated arrival time and burst time. Process   Arrival...

    (Algorithm Computation Question) Given the following processes and associated arrival time and burst time. Process   Arrival Time     Burst Time P1                0.0                    6 P2                2.0                    5 P3                3.0                    2 P4                4.0                    3 1) Calculate the average waiting time if the CPU scheduling uses FCFS algorithm. 2) Calculate the average waiting time if the CPU scheduling uses Non-Preemptive SJF algorithm.

  •          Process                    Arrival Time            &nbsp

             Process                    Arrival Time                             Burst Time                         P1                                0                                              2                         P2                                1                                              1                         P3                                2                                              4                         P4                                3                                              2                         P5                                4                                              1 Consider a set of processes given above with the arrival time and the length of CPU burst time given in cycles. Show a Gantt chart and calculations of average turnaround time and average waiting time of these processes under the shortest job first (SJF) with preemption CPU scheduling algorithm and the round-robin...

  • From the Gantt chart, the waiting time and the turnaround time are calculated as:

    Round Robin Schedulin ProcessBurst Time in MsP14P22P32Calculate the average waiting time and turnaround time using round robin scheduling, where the time quantum q = 2 ms According to the Round Robin algorithm, the arrival of processes is shown in the following Gantt chart. From the Gantt chart, the waiting time and the turnaround time are calculated as: Waiting time for P1= Waiting time for P2 = Waiting time for P2 = Therefore, the average waiting time = Turnaround time =

  • Q.2] Answer the following questions Process Burst Time Priority P1 3 1 P2 8 3 P3...

    Q.2] Answer the following questions Process Burst Time Priority P1 3 1 P2 8 3 P3 2 4 P4 4 5 P5 5 1 (21 points) Consider the set of processes shown in the table above, with the length of the CPU-burst time given in milliseconds. The processes are assumed to have arrived in the order P5, P4, P3, P2 , and P1, all approximately at time 0. Draw three Gantt charts illustrating the execution of these processes using SJF,...

  • Cpu scheduling

    Consider the following set of processes, with the length of the CPU burst times given in milliseconds:a. Draw four Gantt charts illustrating the execution of the processes using FCFS, Preemptive SJF, a non-preemptive priority, and a RR (quantum=2) scheduling. (30 pts)Note: for the RR consider that the arriving time is 0 for all processesb. What is the average waiting time of each process for of the above scheduling algorithms? (10 pts)P1 8 2 0 P2 5 36P3 1 1 8...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT