© 2015, IJCSMC All Rights Reserved
139
Available Online at www.ijcsmc.comInternational Journal of Computer Science and Mobile Computing
A Monthly Journal of Computer Science and Information Technology
ISSN 2320–088X
IJCSMC, Vol. 4, Issue. 12, December 2015, pg.139 – 147
Analysis of Adaptive Round Robin
Algorithm and Proposed Round Robin
Remaining Time Algorithm
Arpita Sharma
1, Mr. Gaurav Kakhani
2¹M. Tech. Scholar, Department of Computer Science & Engineering, Mewar University, India ²Asst. Professor, Department of Computer Science & Engineering, Mewar University, India
1
[email protected]; [email protected] 2
Abstract— The Round Robin Scheduling Algorithm is designed especially for time sharing system. Each process is assigned
a time interval, called its time quantum, during which it is allowed to run. Each process is provided a fix time to execute
called time quantum. The Round Robin Scheduling algorithm is a fair scheduling algorithm that gives equal time quantum
to all processes. The choice of the time quantum is critical as it affects the algorithm’s performance. This paper is all about
the study of Adaptive Round Robin Algorithm and Proposing a new algorithm Round Robin Remaining Time Algorithm
which will improve the performance of Adaptive Round Robin Algorithm in terms of Average Waiting Time (AWT) and
Average Turnaround Time (ATT).
Keywords— ―Operating System, Scheduling Algorithm, Round Robin, Average Waiting Time, Average Turnaround Time‖
I. INTRODUCTION
© 2015, IJCSMC All Rights Reserved
140
The Standard Round Robin Scheduling Algorithm is designed especially for time sharing system. Each process is assigned a time interval, called its time quantum, during which it is allowed to run. Each process is provided a fix time to execute called time quantum. A time quantum is generally from 10 to 100 milliseconds. The ready queue is treated as a circular queue. The CPU scheduler goes around the ready queue, allocating the CPU to each process for a time interval of up to 1 time quantum [2]. Adaptive Round Robin Scheduling Algorithm using Shortest Burst Approach Based on Smart Time Slice, It is a Priority Driven Scheduling Algorithm based on burst time of processes. First of all arrange the processes according to the execution time / burst time in increasing order that is smallest the burst time higher the priority of the running process. The next idea of this approach is to choose the smart time slice (STS) is mainly depends on number of processes [3].Round Robin Remaining Time Algorithm processes are assigned to the ready queue on the basis of burst time then rearrange all the process in increasing order of their burst time. Time quantum can be calculated by ∑pi / 2n. If the remaining CPU burst time of the currently running process is less than the time quantum, the CPU is again allocated to the currently running process for remaining CPU burst time. Otherwise if the remaining CPU burst time of the currently running process is longer than the time quantum, the process will be put at the tail of the ready queue.
II. LITERATUREREVIEW
Soraj and Roy, 2011 [3] proposed a new algorithm that arranges the processes in ascending order of burst time, and then it chooses the smart time slice (STS), which is mainly dependant on the number of processes. “Adaptive Round Robin Scheduling using Shortest Burst Approach Based on Smart Time Slice”. It is a Priority Driven Scheduling algorithm based on burst time of processes. First of all, it arranges the processes according to the execution time/burst time in increasing order that is the smaller the burst time, the higher the priority of the running process. The next idea of this approach is to choose the smart time slice (STS), which is mainly dependant on the number of processes. The smart time slice is equal to the burst time of the mid process, when the number of processes is odd. If the number of processes is even, then the smart time slice (STS) will be the average of the CPU burst of all running processes. Based on the experiments and calculations, the algorithm radically solves the fixed time quantum problem which is considered a challenge for Round Robin Scheduling Algorithm. This algorithm assumes that all processes arrive at the same time in the ready queue.
Ishwari and Deepa, 2012 [4] proposed algorithm which improves all the drawbacks of round robin CPU scheduling algorithm. The paper also presents the comparative analysis of proposed algorithm with existing round robin scheduling algorithm on the basis of varying time quantum, average waiting time, average turnaround time and number of context switches [8].
Saeidi and Hakimeh, 2012 [5] proposed an algorithm which determined the Optimum Time Quantum Value in Round Robin process scheduling method, the operation and performance of the algorithm were analysed over some algorithms in the literature of the work and also over the Standard Round Robin Scheduling Algorithm. It does this by using a new non-linear mathematical model which calculates the optimum value of the time quantum in Round Robin scheduling algorithm, in order to minimize the average waiting time of the processes.
© 2015, IJCSMC All Rights Reserved
141
III.OBJECTIVE The aim of this paper work as the following:
Analysis of Adaptive Round Robin and Proposed a new algorithm Round Robin Remaining Time Algorithm.
Comparison of Round Robin Remaining Time Algorithm with Standard Round Robin and Adaptive Round Robin in terms of Average Waiting Time and Average Turnaround time.
IV.PROPOSEDALGORITHM Following is the proposed Round Robin Remaining Time Algorithm:
Step 1: Assign Process to ready queue.
Step 2: Rearrange all the process in increasing order of their burst time Step 3: While (ready queue! =NULL)
Step 4: Calculate time quantum =∑pi / 2
*n
Step 5: If (remaining burst time < time quantum )
Allocate CPU again to the current running process for remaining burst time Else
Remove the current running process from the ready queue and put it at the tail of the ready queue. Step 6: If no of process > 0
Go to step 5 Step 7: End while
Step 8: Calculate average waiting time, average turnaround time.
V. RESULTS
Case I: Input component for the processes in increasing order
With five processes and their increasing burst time (P1 = 14, P2 =34, P3 = 45, P4 = 62, P5= 77) shown in Table 1. Figure 1, Figure 2 and Figure 3 shows Gantt chart for three algorithms Standard Round Robin, Adaptive Round Robin and Round Robin Remaining Time Algorithm respectively.
Table 1
Input component for the processes in increasing order [11]
Process Name CPU Burst Time (ms)
P1 14
P2 34
P3 45
P4 62
P5 77
Standard Round Robin Algorithm
© 2015, IJCSMC All Rights Reserved
142
Gantt chart
P1 P2 P3 P4 P5 P2 P3 P4 P5 P4 P5
0 14 39 64 89 114 123 143 168 193 205 232
Figure 1: Gantt Chart for Standard Round Robin Algorithm (Case I)
Average Waiting Time: 97ms Average Turnaround Time: 143.4ms
Adaptive Round Robin algorithm
First of all, arrange the processes in ready queue according their given burst time in increasing order that is P1=14, P2=34, P3=45, P4=62 and P5=77 and after that choose the time quantum according Adaptive RR algorithm, the time quantum is the mid process burst time if the given processes are odd, that is 45.
Gantt chart
P1 P2 P3 P4 P5 P4 P5
0 14 48 93 138 183 200 232
Figure 2: Gantt Chart forAdaptive Round Robin Algorithm (Case I)
Average Waiting Time: 71ms Average Turnaround Time: 117.4ms
Round Robin Remaining Time Algorithm
First of all, arrange the processes in ready queue according their given burst time in increasing order that is P1=14, P2=34, P3=45, P4=62 and P5=77 and after that calculate the time quantum according Round Robin Remaining Time Algorithm. The time quantum is 23..
Gantt Chart
P1 P2 P3 P4 P5 P4 P5
0 14 48 93 116 139 178 232
Figure 3: Gantt Chart for Round Robin Remaining Time Algorithm (Case I)
Average waiting Time: 66.6ms Average Turnaround Time: 113ms
Simulation Result of Case I
© 2015, IJCSMC All Rights Reserved
143
Case II: Input component for the processes in decreasing order
With five processes and their decreasing burst time (P1 = 83, P2 =54, P3 = 30, P4 = 19, P5= 8) as shown in Table 2. Figure 5, Figure 6 and Figure 7 shows Gantt chart for Standard Round Robin, Adaptive Round Robin and Round Robin Remaining Time Algorithm respectively.
Table 2
Input component for the processes in decreasing order [11]
Process CPU Burst Time
P1 83
P2 54
P3 30
P4 19
P5 8
Standard Round Robin Algorithm
Enter processes in ready queue according to their given burst time in order that is P1=83, P2=54, P3=30, P4=19 and P5=8 with time quantum= 26.
Gantt Chart
P1 P2 P3 P4 P5 P1 P2 P3 P1 P2 P1
0 26 52 78 97 105 131 157 161 187 189 194
Figure 5: Gantt Chart for Standard Round Robin Algorithm (Case II)
Average Waiting Time: 110.4ms Average Turnaround Time: 149.2ms
Adaptive Round Robin Algorithm
First of all, arrange the processes in ready queue according to their given burst time in increasing order that is P5=8, P4=1 9, P3=30, P2=54 and P5=83 and after that choose the time quantum according to Adaptive Round Robin Algorithm, the time quantum is the mid process burst time if the given processes are odd, that is 30.
Gantt Chart
P5 P4 P3 P2 P1 P2 P1
0 8 27 57 87 117 141 194
Figure 6: Gantt Chart for Adaptive Round Robin Algorithm (Case II)
Average Waiting Time: 46.6ms Average Turnaround Time: 85.4ms
Round Robin Remaining Time Algorithm
First of all, arrange the processes in ready queue according to their given burst time in increasing order that is P5=8, P4=1 9, P3=30, P2=54 and P5=83 and after that calculate the time quantum according to Round Robin Remaining Time Algorithm. The time quantum is 19.
Gantt Chart
P5 P4 P3 P2 P1 P2 P1
0 8 27 57 76 95 130 194
© 2015, IJCSMC All Rights Reserved
144
Average Waiting Time: 44.4ms Average Turnaround Time: 83.2ms
Simulation Result of Case II
Figure 8: RRRT Result for Case II Analysis and Results of Case-I and Case-II
The analysis is based on the comparison of Standard Round Robin Algorithm, Adaptive Round Robin Algorithm and Round Robin Remaining Time Algorithm in terms of Average Waiting Time and Average Turnaround Time.
Case-I
Table of Comparison of Standard Round Robin, Adaptive Round Robin and Round Robin Remaining Time Algorithm is given below:
Table 3
Comparison of Standard RR, Adaptive RR and RRRT Algorithm
Algorithm Time Quantum Average Waiting Time Average Turn Around Time
Standard Round Robin 25 97 143.4
Adaptive Round Robin 45 71 117.4
RRRT Algorithm 23 66.6 113
Graphical Representation of Case-I
© 2015, IJCSMC All Rights Reserved
145
Figure 9: Comparative Graph for Average Waiting Time (Case I)
The figure 10 shows the comparison of average turnaround time between Standard Round Robin Algorithm, Adaptive Round Robin Algorithm and Round Robin Remaining Time Algorithm.
Figure 10: Comparative Graph for Average Turnaround Time (Case I)
Case-II
Table of Comparison of Standard Round Robin, Adaptive Round Robin and Round Robin Remaining Time Algorithm is given below:
Table 4
Comparison of Standard RR, Adaptive RR and RRRT Algorithm (Case II)
Algorithm Time Quantum Average Waiting Time Average Turn Around Time
Standard Round Robin 26 110.4 149.2
Adaptive Round Robin 30 46.6 85.4
RRRT Algorithm 19 44.4 83.2
0
20
40
60
80
100
120
Standard Round Robin
Algorithm
Adaptive Round Robin
Algorithm
Round Robin Remaining
Time Algorithm
T
im
es
in m sCPU Scheduling Algorithms
Average Waiting Time
0
20
40
60
80
100
120
140
160
Standard Round Robin
Algorithm
Adaptive Round Robin
Algorithm
Round Robin Remaining
Time Algorithm
T
im
es
in
m
s
© 2015, IJCSMC All Rights Reserved
146
Graphical Representation of Case-II
The figure 11 shows the comparison of average waiting time between Standard Round Robin Algorithm, Adaptive Round
Robin Algorithm and Round Robin Remaining Time Algorithm
.
Figure 11: Comparative Graph for average waiting time (Case II)
The figure 12 shows the comparison of average turnaround time between Standard Round Robin Algorithm, Adaptive Round Robin Algorithm and Round Robin Remaining Time Algorithm.
Figure 12: Comparative Graph for Average Turnaround Time (Case II)
After studying all graphs regarding case I and case II it can be said that out of these three algorithms Round Robin Remaining Time Algorithm is best in terms of average waiting time and average turnaround.
CONCLUSION
This comparative study of three CPU Scheduling Algorithm Standard Round Robin Algorithm, Adaptive Round Robin Algorithm and Round Robin Remaining Time Algorithm, shows that the Round Robin Remaining Time Algorithm reduces the Average Waiting Time(AWT) and Average Turnaround Time (ATT) in both cases of increasing order and decreasing order of burst time of processes, So it can be said that Round Robin Remaining Time Algorithm improves performs better than Standard Round Robin Algorithm, Adaptive Round Robin Algorithm in terms of Average Waiting Time (AWT) and Average Turnaround time(ATT).
0
50
100
150
Standard Round Robin
Algorithm
Adaptive Round Robin
Algorithm
Round Robin Remaining
Time Algorithm
T
im
es
in m sCPU Scheduling Algorithms
Average Waiting Time
0
20
40
60
80
100
120
140
160
Standard Round Robin
Algorithm
Adaptive Round Robin
Algorithm
Round Robin Remaining
Time Algorithm
T
im
es
in
m
s
© 2015, IJCSMC All Rights Reserved
147
REFERENCES
[1] “Abraham Silberschatz , Peter B. Galvin and Greg Gagne, 2004” Operating Systems Concepts. 7th Edn., John Wiley and Sons, USA., ISBN: 13: 978-0471694663, pp: 188.
[2] “Tanebaun,A.S., 2008” Modern Operating Systems. 3rd Edn. Prentice Hall, ISBN:13: 9780136006633, pp: 1104.
[3] SAROJ HIRANWAL, Dr. K.C. ROY “Adaptive Round Robin Scheduling using Shortest Burst Approach Based on Smart Time Slice”, International Journal of Computer Science and CommunicationVol. 2, No. 2, July-December 2011, pp. 319-323.
[4] Ishwari, S. R and Deepa, G. (2012).,”A Priority based Round Robin CPU Scheduling Algorithm for Real Time Systems” International Journal of Innovations in Engineering and Technology , Vol. 1, Issue 3, pp1-11.
[5] Saeidi, Hakimeh Alemi Baktash, “Determining the Optimum Time Quantum Value in Round Robin Process Scheduling Method” I.J. Information Technology and Computer Science , Vol 10, September 2012, pp 67-73
[6] Manish Kumar Mishra, Faizur Rashid, “An Improved Round Robin CPU Scheduling Algorithm With Varying Time Quantum”, International Journal of Computer Applications (0975 – 8887) Volume 75, pp 9-14.
[7] Samih, M. M, Rida, S. Z and Safwat H. H,” Finding Time Quantum Of Round Robin CPU Scheduling Algorithm In General Computing Systems Using Integer Programming” IJRRAS , 5 (1), 64-71.
[8] H.S Behera, Brajendra, Kumar Swain, Anmol Kumar Parida, “A New Proposed Round Robin with Highest Response Ratio Next (RRHRRN) Scheduling Algorithm for Soft Real Time Systems” International Journal of Engineering and Advanced
Technology, Vol. 1,February 2012, pp. 200-206.
[9] Abbas Noon, Ali Kalakech and Seifedine Kadry, “A New Round Robin Based Scheduling Algorithm for Operating Systems: Dynamic Quantum Using the Mean Average,” International Journal of Computer Science, vol. 8, no. 1, May
2011, pp. 224-229.
[10] Debashree Nayak, Sanjeev Kumar Malla, and Debashree Debadarshini, “Improved Round Robin Scheduling using Dynamic Time Quantum”, International Journal of Computer Applications, Vol. 38, No. 5, January 2012, pp 34-38.
[11]Srishty Jindal,Priyanka Grover, ” Two Queue based Round Robin Scheduling Algorithm for CPU Scheduling” International Journal of Computer Applications (0975 – 8887) Volume 105 – No. 5, November 2014, pp 21-24.
[12]William Stalling, Operating System Internals and Design Principles”, 7
th