Round Robin Schedulin
| Process | Burst Time in Ms |
|---|---|
| P1 | 4 |
| P2 | 2 |
| P3 | 2 |
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.

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 =
SOLUTION :
Hey there,
This question is simple and this method is one of the famous method(ROUND ROBIN) in time scheduling for CPU.
First let me explain you some of the terms.
All the processes to be performed are represented as Pi,where i=1,2,3....n for n processes.
ROUND ROBIN is a preemptive process scheduling algorithm.
QUANTUM : The maximum time for which a process is allowed to run while processing in the queue.
BURST TIME : It is the maximum time for a process that it can take to finish.generally a process may or may finish at once.It depends on the Quantum value.
TAT(TURN AROUND TIME) : It is the time difference between the completion time and arrival time according to the Gantt Chart . ex - if a process initially starts at 1 and finally completed at 10 (means deleted from the scheduling queue) then TAT of that process = 10-1=9.
WAITING TIME :The summation of time interval Between two intervals when a process is again comes for execution is called Waiting Time of that process. ex-process P1 ends at 18 hence it waits in the interval ( 2-6,8-12,14-16 ) so total WT=4+4+2=10 ms.
Now, Coming to the question ,
from given Gantt Chart,
Waiting Time for P1 : waits in the interval 2-6,8-12,14-16(note that here - is used for interval purpose not the negative sign).
WT( P1 )= (6-2)+(12-8)+(16-14)=4+4+2=10
Waiting Time for P1 = 10 ms.
Waiting Time for P2 : waits in the interval 0-2,4-8,10-14.
WT( P2 )= (2-0)+(4-8)+(10-14)=2+4+4=10
Waiting Time for P2 = 10 ms.
Waiting Time for P3 : waits in the interval 0-4,6-10,12-15.
WT( P3 )= (4-0)+(10-6)+(15-12)=4+4+3=11
Waiting Time for P3 = 11 ms.
SO AVERAGE WAITING TIME = (10+10+11) / 3 = 10.33
Now for TURN AROUND TIME we need to find arrival time(AT) and completion time(CT)
Process AT CT TAT
P1 0 18 18(18-0)
P2 2 14 12(14-2)
P3 4 16 12(16-4)
Thus above is the turn around time(TAT).
From the Gantt chart, the waiting time and the turnaround time are calculated as:
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...
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...
Opearting
system
5. [27pts.] Given the following set of processes, with arrival times, priorities, and the length of the CPU burst in ms: Process Arrival Time Burst time Priority P1 P2 P3 2 10 P4 (Note: a lower number means higher priority; processes P2- P4 arrive at the same time, in the given order) a. Draw a Gantt chart showing a FCFS scheduling algorithm. b. Draw a Gantt chart showing a non-preemptive Priority scheduling algorithm. Draw a Gantt chart showing...
5. [27pts.] Given the following set of processes, with arrival times, priorities, and the length of the CPU burst in ms: Priority Burst time Arrival Time Process 3 P1 4 P2 2 10 P3 P4 (Note: a lower number means higher priority) Draw a Gantt chart showing a FCFS scheduling algorithm. a. b. Draw a Gantt chart showing a non-preemptive Priority scheduling algorithm. c. Draw a Gantt chart showing a Round Robin Scheduling algorithm with quantum of 4ms d. Compute...
C language show all work
1. [50 pts] Given the following set of processes, with arrival times, priorities, and the length of the CPU burst in ms: Priority Arrival Time Burst time Process P1 P2 P3 P4 4. 3 2 0 0 10 (Note: lower number means higher priority, processes P1, P2, P3, and P4 arrive at the same time, in the given order). a. Draw a Gantt chart showing a FCFS scheduling algorithm. b. Draw a Gantt chart showing...
Compute turnaround time with preemptive priority scheduling. Also compute the average turnaround time. Show the Gantt chart and other details. Process CPU Burst time Arrival time Priority P1 25 5 5 P2 10 10 3 P3 15 15 4 P4 20 20 2 P5 30 25 1
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...
Assume that the three processes arrived in order: Processes CPU Burst Time P1 17 P2 6 P3 8 a. Please draw the Gantt chart if FCFS scheduling is used. b. Please calculate the average waiting time and average completion time under FCFS. You MUST show the calculation procedure. c. Please draw the Gantt chart if Round Robin is used. d. Please calculate the average waiting time and completion time under RR with q = 3. You MUST show the calculation...
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)
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,...