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:
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)
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:Processburst TimePriorityP1103P211P323P414P552For each of the scheduling algorithms, FCFS, Shortest-Job-First (SJF, non-preemptive), Priority (smaller priority number implies higher scheduling priority), and RR (quantum = 1) do the following.Draw a Gantt chart to show how these processes would be scheduled.Give the turnaround time (total time from the first arrival into ready state until CPU-burst is completed) of each process.Give the waiting time (total time spent in the Ready state) of each process.Give...
a-) Draw the gantt chart and computecpu waiting time using preeptive-priority algorithm for the cpu I/O device is using FCFS. Compute cpu utilization as well. b-) Draw the gantt chart and compute cpu waiting time using round-robin algorithm for the cpu where quantum is 3 milli seconds. Compute cpu utilization as well. comp 214 2019/2020 Summer School Assignment 1 Priority Arrival Time 4 cpu 12 cpu 6. 3 3 P2 2 4 2 4 loane P3 4 ㅋ 8 6...
Need the process that how we get P2 P1 P4 P3 and waiting time please 1. Draw a Gantt chart below similar to the ones from lecture that illustrates the execution of the processes using the shortest-job-first CPU scheduling algorithm. Process Arrival Burst | Time Time P. 7 ms 2 ms | P2 Oms 8 ms 11 ms 5 ms P4 4 ms 9 ms P2 P2 P4 P3 oms 8 10 19 24 | Using the chart you drew,...