266 Jurnal Teknik Informatika dan Sistem Informasi ISSN 2407-4322 Vol. 10, No. 1, Maret 2023, Hal. 266-272 E- ISSN 2503-2933
Comparison Between Simple Round Robin And Improved Round Robin Algorithms
Tri Dharma Putra1, Rakhmat Purnomo2*
1,2Computer Science, Universitas Bhayangkara Jakarta Raya, DKI Jakarta
e-mail: 1[email protected] *2[email protected], Abstract
The objective of this journal is to compare the efficiency between these two algorithms, the simple round robin and improved round robin algorithms. In real time systems algorithm, round robin plays a significant role to be used in embedded systems. Here we compare the average turn around time and average waiting time, also number of context switching between these two algorithms. Improved round robin algorithm, is an algorithm where if the remaining burst time is less than the allocated time quantum then the running process is executed. Then remove the currently running process from ready queue and put it in the tail of the ready queue while in simple round robin algorithm the remaining burst time will be executed until finish as scheduled. This comparison proves that improved round robin algorithm is more efficient, with lower average turn around time and lower average waiting time, lower context switching. There by this increases the system throughput.
Keywords -- Round Robin Algorithm, Improved Round Robin Algorithm, Average Turn Around Time, Average Waiting Time, Context Switching
1. INTRODUCTION
rocess scheduling is very important in operations of operating system (OS). Operating system is an interface between computer hardware and its user. Operating systems help user use the computer more easily, so that user does not have to know the hardware behind it. All application is installed to the operating system’s API. Operating systems handle the system in a convenient manner [1]. Modern operating systems until now becomes more complex.
Scheduling refers to set of rules, policies and mechanism that govern the order in which resources is allocated to various processes and the work is to be done. The scheduling is a methodology of managing many queues of processes in order to make delay minimum and to make performance optimal of the system [2]. System switches between process so that multitasking program can be handled. It provides a means for the user to work with computer.
Operating system performs major functions like memory management, process scheduling and resource management [3].
Round robin algorithm is a real-time scheduling algorithm in operating system. Static and dynamic time slice is a solution so that operating systems can be operated more effectively. The improved round robin algorithm is a modification of simple round robin algorithm with the idea to make the scheduling more effective. With lower average turn around time and lower average waiting time. Also reduce the context switching. Simple round robin architecture is difficult to be implemented in real time operating systems because of high context switch rate, larger waiting time and larger respons time [4]. The standard round robin scheduling algorithm is designed especially for time sharing system. Each task is assigned a time slice or quantum [5], [6], which is a time interval.
P
Jatisi ISSN 2407-4322
Vol. 10, No. 1, Maret 2023, Hal. 266-272 E- ISSN 2503-2933 267
Dhruv, proposed, a new modified algorithm, processes are organized in rising order of burst time. The dynamic time quantum is used based on the remaining shortest burst time. And time quantum of this algorithm is substantial. Round robin is similar to FCFS (First Come First Serve). Time quantum is important and plays a significant role in performance of round robin algorithm. If time quantum of given algorithm is short, it will result in extravagant context switchings [7].Lipika Datta proposed, a new modified round robin algorithm by adjusting time slices (quantum) of different rounds depending on the remaining CPU burst of currently running processes and considering their waiting times until that round in respect of the other processes waiting times. Based on experimental analysis it is concluded that the proposed algorithm produces better average turnaround time, average waiting time and fewer number of context switchings than existing algorithm [8].
Govind Prasad Arya, Kumar Nilay, Devendra Prasad, proposed a new algorithm that categorizes available processes based on process with high priority and low priority. This algorithm reduces the average waiting time of process that have high priority in all cases. And of process with low priority in not all but some cases. The overall waiting time changes on the basis of set of processes considered [9].
Manish Kumar Mishra and Faizur Rashid proposed an improved Round Robin CPU scheduling algorithm which enhancing performance of CPU using the features of Shortest Job First (SJF) and Round Robin algorithms by using varying time quantum. The proposed algorithm based on experiment was proven better than simple round robin [10].
M. Laxmi Jeevani, T.S.P. Madhuri, and Y. Sarada Devi, proposed algorithm by using a few steps. a) Allocate process to CPU which has arrived first, giving an initial time quantum (k units). b) After the completion of first process initial execution the scheduler will check the queue for processes which have arrived by the time of completion of first process execution with initial time quantum. Subsequently, among the multiple processes that have arrived in the queue by the k units of time, the process with the minimum burst time is allocated to the CPU.
If the first process has completed its execution, it is removed from the queue or again a chance is provided to it. Lastly, for the complete execution of all processes we have to repeat the same [11].
Neha and Ankita Jiyani proposed an improved round robin algorithm [12]. Take the first process in the ready queue and execute it until the allocated time quantum, then we check the remaining burst time of the running process. If the remaining burst time is less than the allocated time quantum then thea running process is executed again till it finishes. But if the remaining burst time of the running process is more than the allocated time quantum, then the next process in the ready queue is executed.
What proposed by Neha And Ankita Jiyani, is a simple improvement from the research before. The basic idea to continue the execution of the process if the remaining burst time is below the quantum time, proved by their experiments improve the efficiency. Instead of using shortest job first algorithm proposed by Manish Kumar and Rashid, and other algorithms discussed above, Neha and Ankita Jiyani proved to be more simple. Simplicity in this algorithm is a great idea from the previous researches.
2. RESEARCH METHOD
Here, in this journal, we have four chapters. In the first chapter, an introduction is given.
Here we discuss about the story behind round robin algorithm and we discuss about some literature surveys about some modifications of round robin algorithm proposed by experts. The second chapter, is about research method used in improved round robin algorithm. In the third
268 Jatisi ISSN 2407-4322 Vol. 10, No. 1, Maret 2023, Hal. 266-272 E-ISSN 2503-2933
IJCCS Vol. x, No.
chapter, we discuss about result and analysis. One case study is presented here. This is our main subject. This chapter is the comparison analysis of simple round robin and improved round robin algorithms. Here we discuss the result analysis between the two. The last chapter is conclusion and future works.
Round robin algorithm is scheduling algorithm with time quantum. Each process is assigned a time interval which is called time slice or quantum. Round robin is a preemptive algorithm. If the quantum ends, and the tasks are still executing, then the algorithm will force the next queue to pre-empt the task and keep it at the end of the ready queue. The choice of the quantum is critical in this algorithm, since this will give great effect on performance of the algorithm.
In improved round robin scheduling algorithm, Neha and Ankita Jiyani [12] proposed as follows:
• Take the first process in the ready queue and execute it until the allocated time quantum, then check the remaining burst time of the running process.
• If the remaining burst time of the running process is more than the allocated time quantum then the next process in ready queue is executed.
• We remove the currently running process from the ready queue and put it at the tail of the ready queue.
Let us discuss the idea of this algorithm by example. If there are processes T1 and T2. T1 with 7 ms burst time and T2 with 6 ms burst time. And time quantum is 4. When the first quantum is executed, the remaining of T1 is 3 ms. After 4 ms is executed, this will not be preemptived because the remaining of T1 is 3 which is below the quantum. Then the process of T1 continues until finish. Then T2 is executed which makes the remaining of T2 is 2. This process will not be preemptived because the remaining of the process is 2 ms for T2. Which is below the quantum. So T2 is executed until finish, because the remaining time is less than the quantum. As we can see in the gantt chart of Figure 1. below:
T1 = 7 ms, T2 = 6 ms, Quantum = 4 ms
Figure 1. Gantt Chart of Basic Concept Improved Round Robin With Quantum 4.
3. RESULTS AND ANALYSIS
The example case study below is for evaluation of the analysis. We put the arrival time all zero for this analysis. But the burst times are taken randomly. Please take a look at the Table 1.
below:
Table 1. Task Burst Time
Task ID Arrival Time Burst Time
T1 0 9
T2 0 14
T3 0 10
T4 0 12
T5 0 13
Jatisi ISSN 2407-4322
Vol. 10, No. 1, Maret 2023, Hal. 266-272 E- ISSN 2503-2933 269
The case study is with 5 tasks. T1 until T5. And the CPU burst time 9, 14, 10, 12 and 13.The arrival times are zero for all. Total burst time is 58. We use in this case study, time quantum 4.
3.1. Analysis of Simple Round Robin
Please take a look at Figure 2. Since quantum is 4, T1 is executed for 4ms. T1 is left 5.
Then T2 is executed 4ms, T2 is left 10. At t=8 T3 is executed for 4ms until t=12. T3 is left 6.
Then subsequently T4 is executed until t=16. T4 is left 8. The last process, T5 is executed until t=20. T5 is left 9. Then the systems come back to T1 again. T1 is executed 4ms, T1 is left 1.
Then T2 is executed from t=24 until t=28. T2 is left 6. Then T3 is executed from t=28 until t=32. T3 is left 2. At t=32 T4 is executed 4ms, T2 is left 2. then T5 is executed 4ms until t=40.
At t=40, the only one of T1 is executed. Then T2 is executed 4ms, T3 is executed only 2ms, since left 2. Then T4 is executed 4ms. Then T5 is executed 4ms. T5 is left 1. The come back again to T2 which is executed 2ms. Then the last one of T5 is executed. Overall 58 mili seconds is executed for this simple round robin algorithm.
Figure 2. Gantt Chart of Simple Round Robin For calculation of waiting time, we get as follow:
T1=0+(20-4)+(40-24)=32
T2=4+(24-8)+(41-24)+(55-45)=47 T3=8+(28-12)+(45-32)=37
T4=12+(32-16)+(47-36=39
T5=16+(36-20)+(51-40)+(57-55)=45
It is concluded that for simple round robin algorithm, the average waiting time is 200/5=40.
Then we calculate the turn around time. First step is, we populate the table below for turn around time analysis, as per Table 2 below:
Table 2. Turn Around Time Of Simple Round Robin
Process Arrival Time Burst Time Start Time Finish Time Turn Around Time
T1 0 9 0 41 41
T2 0 14 4 57 57
T3 0 10 8 47 47
T4 0 12 12 51 51
T5 0 13 16 58 58
From Table 2. above, we can conclude that the average turn around time is (41+57+47+51+58) = 254/5 = 50.8 ms..
270 Jatisi ISSN 2407-4322 Vol. 10, No. 1, Maret 2023, Hal. 266-272 E-ISSN 2503-2933
IJCCS Vol. x, No.
3.2. Analysis of Improved Round Robin
Please take a look at figure 3. At t=0, since quantum is 4, then T1 is executed 4 ms. T1 is left 5. Then at t=4 T2 is executed until t=8 ms. T2 is left10. Then T3 is executed from t=8 until t=12. T3 is left 6. At t=12 T4 is executed until t=16, with quantum four, then T4 is left 8. Then at t=16 T5 is executed with quantum four until t=20. Then T5 is left 9. Then system goes again to T1. The T1 is left 5 ms. Then T1 is executed until finish all of them, namely 5 ms until t=25.
At t=25 T2 is executed 4 ms until t=29. At t=29 T3 is executed 6 ms, until t=35. At t=35 T4 is executed 4 ms until t=39. At t=39 T5 is executed until t=43. T5 is left 5ms. At t=43 T2 is executed until t=49, 6 ms. Then at t=49 T4 is executed until t=53, then T4 is finish. The the last one, T5 is executed 5 ms with t=58.
Figure 3. Gantt Chart of Improved Round Robin
For calculation of waiting time, we can get this waiting time by calculation as follow:
T1=0+(20-4)=16
T2=4+(25-8)+(43-29)=35 T3=8+(29-12)=25
T4=12+(35-16)+(49-39)=41 T5=16+(39-20)+(53-43)=45
It is concluded that for improved round robin algorithm, the average waiting time is 162/5=32.4.
Then we populate the table below for the analysis of turn around time, as per Table 3.
Below:
Table 3. Turn Around Time Of Improved Round Robin
Process Arrival Time Burst Time Start Time Finish Time Turn Around Time
T1 0 9 0 25 25
T2 0 14 4 49 49
T3 0 10 8 35 35
T4 0 12 12 53 53
T5 0 13 16 58 58
So the average turn around time is (25+49+35+53+58)=220/5=44 3.3. Comparison Analysis
Based on analysis above, here is the comparison table of number of context switchings, average waiting time, and average turn around time:
Jatisi ISSN 2407-4322
Vol. 10, No. 1, Maret 2023, Hal. 266-272 E- ISSN 2503-2933 271
Table 4. Comparison Table Algorithms Number of Context
Switching
Average Waiting Time
Average Turn Around Time Simple Round
Robin 17 40.0 50.8
Improved Round Robin
13 32.4 44.0
Please take a look at the Table 4. above. For simple round robin, the total context switching is 17, while in improved round robin it is 13. Reducing number of context switching will make the system more efficient. For average waiting time, in simple round robin it is 40 ms, while in improved round robin it is 32.4. This is a reduction of 10,49%. For average turn around time, in simple round robin, it is 50.8 ms, while in improved round robin is 44.0 ms, this is 7.2% lower.
4. CONCLUSION
Based on analysis above, we can prove that improved round robin algorithm was more efficient than the simple round robin algorithm. Based on the number of context switching, we conclude that Improved round robin has lower context switching, namely 13, while in simple round robin it is 17. And for average turn around time we get 50.8 ms in simple round robin while in improved round robin we get average turn around time 44.0 ms. There is reduction of 10.49% of average waiting time in improved round robin. The conclusion is improved round robin algorithm is more efficient than simple round robin algorithm. For future works, the improved round robin algorithm can be modified and combine with priority scheduling like shortest job first algorithm. Other comparisons also can be done, like comparison between intelligent round robin and improved round robin.
REFERENCES
[1] T. Paul, R. Hossain, and M. Samsuddoha, “Improved Round Robin Scheduling Algorithm with Progressive Time Quantum,” Int. J. Comput. Appl., Vol. 178, No. 49, pp. 30–36, 2019, doi: 10.5120/ijca2019919419.
[2] R. Purnomo and T. D. Putra, “Simulation of Preemptive Shortest Job First Algorithm,”
IJARCCE, Vol. 11, No. 5, pp. 1–11, 2022, doi: 10.17148/IJARCCE.2022.11501.
[3] J. R. Indusree and B. Prabadevi, “Enhanced round robin CPU Scheduling With Burst Time Based Time Quantum,” IOP Conf. Ser. Mater. Sci. Eng., Vol. 263, No. 4, 2017, doi:
10.1088/1757-899X/263/4/042038.
[4] R. Ramesh and E. Engineering, “Intelligent Time Slice for Round Robin in Real Time Operating Systems,” Vol. 2, No. February, pp. 126–131, 2010.
[5] A. Sharma and G. Kakhani, “Analysis of Adaptive Round Robin Algorithm and Proposed Round Robin Remaining Time Algorithm,” Int. J. Comput. Sci. Mob. Comput., Vol. 4, No. 12, pp. 139–147, 2015.
272 Jatisi ISSN 2407-4322 Vol. 10, No. 1, Maret 2023, Hal. 266-272 E-ISSN 2503-2933
IJCCS Vol. x, No.
[6] T. D. Putra and A. Fadjriya, “Comparison Between Simple Round Robin and Intelligent Round Robin Algorithms in CPU Scheduling,” IJARCCE, Vol. 10, No. 4, pp. 86–90, 2021, doi: 10.17148/ijarcce.2021.10413.
[7] R. Dhruv, “Round Robin Scheduling Algorithm Based On Dynamic Time Quantum,” Int.
J. Eng. Adv. Technol., Vol. 8, No. 6, pp. 593–595, 2019, doi:
10.35940/ijeat.F8070.088619.
[8] L. Datta, “Efficient Round Robin Scheduling Algorithm with Dynamic Time Slice,” Int. J.
Educ. Manag. Eng., Vol. 5, No. 2, pp. 10–19, 2015, doi: 10.5815/ijeme.2015.02.02.
[9] G. P. Arya, K. Nilay, and D. Prasad, “An Improved Round Robin CPU Scheduling Algorithm Based On Priority of Process,” Int. J. Eng. Technol., Vol. 7, No. 4, pp. 238–
241, 2018, doi: 10.14419/ijet.v7i4.5.20077.
[10] M. Kumar Mishra and F. Rashid, “An Improved Round Robin CPU Scheduling Algorithm with Varying Time Quantum,” Int. J. Comput. Sci. Eng. Appl., Vol. 4, No. 4, pp. 1–8, 2014, doi: 10.5121/ijcsea.2014.4401.
[11] Y. S. D. m. LaxmiJeevani, T.S.P. Madhuri, “Improvised Round Robin Scheduling Algorithm and comparison with Existing Round Robin CPU Scheduling Algorithm,”
IOSR J. Comput. Eng., Vol. 20, No. 3, pp. 1–4, 2018, doi: 10.9790/0661-2003010104.
[12] Neha and A. Jiyani, “An Improved Round Robin CPU Scheduling Algorithm Based On Priority of Process,” Int. J. Eng. Technol., Vol. 7, No. 4, pp. 238–241, 2018, doi:
10.14419/ijet.v7i4.5.20077.