LEAST-MEAN DIFFERENCE ROUND ROBIN (LMDRR) CPU SCHEDULING ALGORITHM

Similar documents
CPU Scheduling Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University

IJCSC VOLUME 5 NUMBER 2 JULY-SEPT 2014 PP ISSN

Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - V CPU Scheduling - I. University at Buffalo.

CPU Scheduling CPU. Basic Concepts. Basic Concepts. CPU Scheduler. Histogram of CPU-burst Times. Alternating Sequence of CPU and I/O Bursts

Roadmap. Tevfik Ko!ar. CSC Operating Systems Spring Lecture - V CPU Scheduling - I. Louisiana State University.

Journal of Global Research in Computer Science

Review of Round Robin (RR) CPU Scheduling Algorithm on Varying Time Quantum

A Paper on Modified Round Robin Algorithm

א א א א א א א א

CPU Scheduling. Chapter 9

Mixed Round Robin Scheduling for Real Time Systems

CSC 1600: Chapter 5. CPU Scheduling. Review of Process States

Pallab Banerjee, Probal Banerjee, Shweta Sonali Dhal

Salisu Aliyu Department of Mathematics, Ahmadu Bello University, Zaria, Nigeria

Chapter 6: CPU Scheduling. Basic Concepts. Histogram of CPU-burst Times. CPU Scheduler. Dispatcher. Alternating Sequence of CPU And I/O Bursts

CPU scheduling. CPU Scheduling

CPU Scheduling: Part I. Operating Systems. Spring CS5212

CPU SCHEDULING. Scheduling Objectives. Outline. Basic Concepts. Enforcement of fairness in allocating resources to processes

Simulation of Process Scheduling Algorithms

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

Asia Pacific Journal of Engineering Science and Technology

CPU Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms. Unix Scheduler

Process Scheduling Course Notes in Operating Systems 1 (OPESYS1) Justin David Pineda

Comp 204: Computer Systems and Their Implementation. Lecture 10: Process Scheduling

IJRASET: All Rights are Reserved

Scheduling. CSE Computer Systems November 19, 2001

CPU Scheduling. Jo, Heeseung

CS 143A - Principles of Operating Systems

Efficient Round Robin Scheduling Algorithm with Dynamic Time Slice

CSE 5343/7343 Fall 2006 PROCESS SCHEDULING

Improvement of Queue Management for Real Time Task in Operating System

Scheduling Processes 11/6/16. Processes (refresher) Scheduling Processes The OS has to decide: Scheduler. Scheduling Policies

FIFO SJF STCF RR. Operating Systems. Minati De. Department of Mathematics, Indian Institute of Technology Delhi, India. Lecture 6: Scheduling

Motivation. Types of Scheduling

Bhavin Fataniya 1, Manoj Patel 2 1 M.E(I.T) Student, I.T Department, L.D College Of Engineering, Ahmedabad, Gujarat, India ABSTRACT I.

Analysis of Adaptive Round Robin Algorithm and Proposed Round Robin Remaining Time Algorithm

Comparative Analysis of Basic CPU Scheduling Algorithms

Lecture 3. Questions? Friday, January 14 CS 470 Operating Systems - Lecture 3 1

A NOVEL METHOD BASED ON PRIORITY FOR ENHANCEMENT ROUND-ROBIN SCHEDULING ALGORITHM

CPU Scheduling. Jo, Heeseung

Queue based Job Scheduling algorithm for Cloud computing

Principles of Operating Systems

Announcements. Program #1. Reading. Is on the web Additional info on elf file format is on the web. Chapter 6. CMSC 412 S02 (lect 5)

Scheduling I. Today. Next Time. ! Introduction to scheduling! Classical algorithms. ! Advanced topics on scheduling

Design and Performance Evaluation of Smart Job First Dynamic Round Robin (SJFDRR) Scheduling Algorithm with Smart Time Quantum

Process Scheduling for John Russo generated Mon Nov 07 13:57:15 EST 2011

CPU Scheduling. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

CPU Scheduling. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

CPU Scheduling (Chapters 7-11)

Improvised Optimum Multilevel Dynamic Round Robin Algorithm for Optimizing CPU Scheduling

CPU Scheduling. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

CS510 Operating System Foundations. Jonathan Walpole

Intro to O/S Scheduling. Intro to O/S Scheduling (continued)

DRR Based Job Scheduling for Computational Grid and its Variants

CSC 553 Operating Systems

Project 2 solution code

SELF OPTIMIZING KERNEL WITH HYBRID SCHEDULING ALGORITHM

CPU Scheduling. Disclaimer: some slides are adopted from book authors and Dr. Kulkarni s slides with permission

Introduction to Operating Systems. Process Scheduling. John Franco. Dept. of Electrical Engineering and Computing Systems University of Cincinnati

Lecture 6: CPU Scheduling. CMPUT 379, Section A1, Winter 2014 February 5

Lecture 11: CPU Scheduling

Operating Systems Process Scheduling Prof. Dr. Armin Lehmann

A New Proposed Dynamic Quantum for Priority Based Round Robin Scheduling Algorithm

CS 111. Operating Systems Peter Reiher

Operating Systems. Scheduling

Scheduling Algorithms. Jay Kothari CS 370: Operating Systems July 9, 2008

Chapter 9 Uniprocessor Scheduling

CS 153 Design of Operating Systems Winter 2016

Design and Implementation of LST Based Dynamic Scheduler on Real Time OS

A COMPARATIVE ANALYSIS OF SCHEDULING ALGORITHMS

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

Resource Utilization & Execution Time Enhancement by Priority Based Preemptable Shortest Job Next Scheduling In Private Cloud Computing

CSE 451: Operating Systems Spring Module 8 Scheduling

Performance Comparison of RTS Scheduling Algorithms

Reading Reference: Textbook: Chapter 7. UNIX PROCESS SCHEDULING Tanzir Ahmed CSCE 313 Fall 2018

A SURVEY ON TRADITIONAL AND EARLIER JOB SCHEDULING IN CLOUD ENVIRONMENT

SE350: Operating Systems. Lecture 6: Scheduling

Improving Throughput and Utilization in Parallel Machines Through Concurrent Gang

Uniprocessor Scheduling

Operating System 9 UNIPROCESSOR SCHEDULING

TASK SCHEDULING BASED ON EFFICIENT OPTIMAL ALGORITHM IN CLOUD COMPUTING ENVIRONMENT

Comparative Study of Parallel Scheduling Algorithm for Parallel Job

Study and Comparison of VM Scheduling Algorithm in Cloud Computing Using CloudSim Simulator

PERFORMANCE ANALYSIS OF LOAD BALANCING IN CLOUD COMPUTING BY USING SCHEDULING ALGORITHMS

September 30 th, 2015 Prof. John Kubiatowicz

Tasks or processes attempt to control or react to external events occuring in real time RT processes must be able to keep up events

DEADLINE MONOTONIC ALGORITHM (DMA)

Smarter Round Robin Scheduling Algorithm for Cloud Computing and Big Data

An operating system executes a variety of programs: Batch system - jobs Time-shared systems - user programs or tasks

Real-Time Scheduler Design For Embedded System Domain

Advanced Types Of Scheduling

ENGG4420 CHAPTER 4 LECTURE 3 GENERALIZED TASK SCHEDULER

TBP:A Threshold Based Priority Scheduling in Cloud Computing Environment

CS162 Operating Systems and Systems Programming Lecture 10. Tips for Handling Group Projects Thread Scheduling

Processor Scheduling Algorithms in Environment of Genetics

Lecture Note #4: Task Scheduling (1) EECS 571 Principles of Real-Time Embedded Systems. Kang G. Shin EECS Department University of Michigan

Scheduling: Introduction

Homework 2: Comparing Scheduling Algorithms

An Optimized Task Scheduling Algorithm in Cloud Computing Environment

Process Scheduling I. COMS W4118 Prof. Kaustubh R. Joshi hdp://

Transcription:

LEAST-MEAN DIFFERENCE ROUND ROBIN () CPU SCHEDULING ALGORITHM 1 D. ROHITH ROSHAN, 2 DR. K. SUBBA RAO 1 M.Tech (CSE) Student, Department of Computer Science and Engineering, KL University, India. 2 Professor, Department of Computer Science and Engineering, KL University, India. E-mail: 1 rohithroshan.devu@gmail.com, 2 subbarao_cse@kluniversity.in ABSTRACT This article presents a variant of Round Robin Algorithm called Least Mean-Difference Round Robin () Algorithm. First, it calculates the mean of all processes burst times. Then it obtains the difference of each process burst time with the calculated mean. From those differences, it selects the least difference and assigns it to the CPU for executing it for a time slice. When the time slice is expired it suspends the process and checks the remaining burst time of the process if it is less than time quantum then it immediately executes the process, if the remaining time is greater than time quantum then it selects the process with next least difference and execute it for another time slice. This entire process will be repeated until all the processes in the ready queue are finished. The experimental results are compared with Round Robin and Mean-Difference Round Robin algorithms and found that proposed algorithm succeeded in improving CPU efficiency. Keywords: Burst Time, Turnaround Time, Waiting Time, CPU Scheduling, Pre-emptive Scheduling, non Pre-emptive Scheduling,. 1. INTRODUCTION Among key resources of a computer, CPU is the most important component since it is the heart of the system. Hence, scheduling is necessary for OS (Operating System) [1]. For utilizing resources productively, they should be shared among multiple resources and users [2]. Maximum sharing of resources relies on the effective scheduling of processes in a system and its users for the processor, which makes scheduling the processes a key ingredient of multiprogramming OS. Because the processor is a key resource, process scheduling also called CPU scheduling, turns out to be a predominant aspect in accomplishing objectives mentioned above [1]. OS can constitute 3 different types of schedulers: long, medium and short-term schedulers as shown in Figure 1. There are several scheduling algorithms available that differ in efficiency basing on environment that means we believe an algorithm is good in some cases and not in other and vice-versa. A good CPU scheduler should satisfy the following criteria: Figure 1. Queue Diagram For Scheduling Maximize Throughput. (Throughput means number of jobs completed per unit of time.) Minimize Response Time. (Response Time is the time taken to respond for a program.) Minimize Turnaround Time. (Turnaround Time is the total time required for process from submission to its completion.) Minimize Waiting Time. (Waiting Time is the time spent by the process in ready queue.) 51

Maximize CPU Efficiency. (Keeping CPU busy 100% with 0% wastage of CPU cycles.) Assure fairness for all jobs. (Give equal amount of CPU time for all jobs.) To resolve this issue, the CPU Scheduler in most cases utilizes a timing mechanism and interrupts running jobs periodically for a lapse of fixed time slice. After that, the scheduler halts all activities of the job and reschedules it into ready queue. Now, the CPU is allocated another job that runs unless: the timer goes off, an I/O command is issued by the job, or the job is completed. Accordingly, the job is moved to Ready, Wait or Finished queues, respectively. This type of scheduling is called Preemptive Scheduling and the other one is Non- Preemptive Scheduling, which work without interrupts. 2. LITERATURE SURVEY To allot the CPU with jobs in the system, the scheduler depends on Process Scheduling Algorithm which is based on a particular strategy. In early OS non-preemptive scheduling strategies were used, but, in the recent interactive systems, the algorithm should instantly respond to user requests. The scheduling algorithms that are used often were: 2.1 First Come First Serve (FCFS) FCFS scheduling algorithm services the requests as they arrive. It is the easiest scheduling algorithm and utilized as a standard to differentiate other algorithms. FCFS is suitable in conditions in which there is only one application access the resource [3]. 2.2 Shortest Job First (SJF) SJF [4] is non-preemptive and attempts to increase the response time of tasks regarding FCFS. But it needs additional knowledge of every job's service time. It selects the job with the smallest time. The OS will suspend the current job if the next job has less burst time. The main issue with SJF is that larger processes need to wait for a long time. 2.3 Priority Based Scheduling This algorithm allocates every process to CPU basing on the priority associated with it. The processes with higher priorities are executed first and processes with lower priorities are executed later. In the event that different processes with similar priorities, the CPU is allocated to processes on the premise of FCFS. This scheduling algorithm can be either preemptive or non-preemptive depending on nature and environment [5]. 2.4 Round Robin Scheduling (RR) RR is the easiest among CPU scheduling algorithms in an OS, and that allots time slices to every process in circular order and in uniform segments [6] [7] [8], dealing with all process without any priority [9], possibly, the main trouble in RR is with the time slice [10] [10] [11] [12]. Jobs are arranged in the READY Queue in FCFS strategy. The scheduler chooses the first job in the queue and then sets the timer to a time slice, after that it allots the job to the CPU. If the job is finished, then all of its resources are released and removed from the queue. If the job is not finished and the timer goes off, then it is preempted and placed at the end of queue. 2.5 Mean-Difference Round Robin () The existing [13] system minimizes the performance characteristics such as waiting time, context switches and turn-around time by executing following steps: Step 1: Calculate the mean of the burst time for all process. Step 2: Compute the differences for each process burst time and the mean. Step 3: Select the process with largest difference value and allot the CPU with the selected process for a time slice. Step 4: Repeat 1 and 3 steps until all the jobs are finished in READY queue. In the following section, we present our algorithm which enhances CPU scheduling more effectively than Round Robin (RR) and Mean Difference Round Robin (). 3. METHODOLOGY The algorithm presented in the paper computes the average on total processes burst time presented in the ready queue. Then, it ascertains the differences of calculated average and process burst times. In those differences, the algorithm takes the process with the smallest difference value and allots CPU to that process for one time slice. When the time slice is expired, it suspends the process and checks the remaining burst time of the process if it is less than time quantum then it immediately executes the process, if the remaining time is greater than time quantum then it selects the process with next least difference and execute it for another time slice. The algorithm assures the repetition of this procedure until all processes are finished in the ready queue. 52

3.1 Proposed Algorithm Input: BT[] - Array of burst times. PID[] - Array of processes. N - Total number of processes. δ - Time Quantum. Output: Average waiting time () of all processes. Average turnaround time () of all processes. Algorithm: Step 1: Compute the mean of burst time of every process in the ready queue. Sum =+ BT[i]; Mean=Sum/N; Step 2: Compute the mean differences for every process in the ready queue. D[] = Mean-BT[i]; Step 3: Identify the process with smallest difference value. Find Smin[] and PID[]; Avail CPU for executing the process for one time slice. PID[]. BT[i] = BT[i]-δ; Step 4: If the remaining burst time of current running process is less than or equal to TQ (Time Quantum), then continue its execution. PID[]. BT[i] <= δ; Step 5: Later, completing the step 4, select the next process which is having the smallest difference value. Find Smin-1 [] and PID[]; Execute it and repeat step 4. If any two processes have the same mean difference value, then find the shortest process and assign it to the CPU. Step 6: For all the processes in the ready queue repeat step 5. D [] Array of Mean-Difference. Smin Process with smallest difference value. Smin-1 Process with next smallest difference value. Wi Waiting time of i th process. Ti Turnaround time of i th process. 4. EXPERIMENTAL RESULTS Example 1: Consider the set of processes, in the order p1, p2, p3, p4 shown in the Table 1, presumed to have arrived at time t0, with the time quantum 10, 15, 20, 25 and duration of the CPU burst times given in milliseconds. Table 1: Processes With Their Burst Times In Milliseconds Process Id Burst Time P1 53 P2 17 P3 68 P4 24 In the below Table 2 a comparative study of the efficiency of the proposed, RR and the algorithm with different Time Quantum values is showing that the proposed algorithm has the minimum Average Waiting Time and Average Turnaround Time. Table 2: RR, And The Proposed Algorithm Performance Comparison Time Slice 10 15 20 25 RR 75.5 79.25 73 69.25 73 75.5 58 63 Step 7: Repeat step 1 through step 6 until all the processes in the ready queue are finished. 63 54.75 54.75 58.5 Step 8: Calculate the average waiting time of all the processes in the ready queue. =Σ Wi/N; Step 9: Calculate the average turnaround time of all the processes in the ready queue. =Σ Ti/N; RR 117.5 119.5 115.5 109.75 Scheduling: 111 116 96 103 103.5 95.25 95.5 99 53

The mean of burst times in Table 1 is : The comparison graph of RR, and algorithms is presented in Figure 3. 120 The mean-differences of the processes are shown in Table 3. Table 3: Processes Burst Time And Mean-Difference P1 53 12.5 P2 17 23.5 P3 68 27.5 P4 24 16.5 Now the process with least mean difference is allotted to CPU and then the process with next least mean-difference. Like this processes are allotted to CPU in the order P1, P4, P2, P3. In this iteration P2 and P4 are completed. After the first iteration the algorithm again calculates the mean and differences for the remaining processes The mean-differences of the remaining processes are shown in Table 4. Table 4: Remaining Processes Burst Time And Mean- Difference P1 28 7.5 P3 43 7.5 Since both the processes have same mean difference the algorithm selects the process in sequential order i.e., P1. As the P1 completes one time slice, it has only burst time of 3 is remaining which is less than the time quantum 25 so immediately it will be executed. After that P3 will be allotted. Like this, the procedure repeats until all the processes are finished. The complete Gantt chart is shown in the Figure 2. Figure 2: Gantt Chart For Algorithm 100 80 60 40 20 0 10 15 20 25 RR RR Figure 3: Performance Comparison Graph Of RR, And Example 2: Consider the set of processes, in the order p1, p2, p3, p4, p5 shown in the Table 5, presumed to have arrived at time t0, with the time quantum 10, 14, 16, 18 and duration of the CPU burst times given in milliseconds. Table 5. Processes With Their Burst Times In Milliseconds Process Id Burst Time P1 51 P2 22 P3 42 4 18 P5 62 A comparative study of the efficiency of the proposed, RR and the algorithm is shown in the Table 6. 54

Table 6: RR, And The Proposed Algorithm Performance Comparison Time Slice 10 14 16 18 RR 110.6 108.6 113 103.2 108.6 100.2 111.2 97.8 83 85.2 84.2 87.8 RR 149.6 144.8 152 142.2 147.6 138.4 150.2 136.8 The mean-differences of the remaining processes are shown in Table 8. Table 8: Remaining Process Burst Times And Mean- Differences P1 33 0.66 P3 24 9.66 P5 44 10.34 The processes are allotted to CPU in the order P1, P3, P5. In this iteration process P1 and P3 will be completed. Like this, the procedure repeats until all the processes are finished. The complete Gantt chart is shown in the Figure 4. 133.6 122.6 123.2 126.8 Scheduling: The mean of the burst times in Table 5 is: Figure 4: Gantt Chart For Algorithm The comparison graph of RR, and algorithms is presented in Figure 5. 160 The mean-differences of the processes are shown in Table 7. Table 7: Processes Burst Time And Mean-Difference P1 51 12 P2 22 17 P3 42 3 P4 18 21 P5 62 23 Now the process with least mean difference is allotted to CPU and then the process with next least mean-difference. Like this processes are allotted to CPU in the order P3, P1, P2, P4, P5. In this iteration P2 and P4 are completed. After the first iteration the algorithm again calculates the mean and differences for the remaining processes 140 120 100 80 60 40 20 0 10 14 16 18 RR RR Figure 5: Performance Comparison Graph Of RR, And 55

5. CONCLUSION This paper presents a form of Round Robin scheduling algorithm called Least Mean-Difference Round Robin () algorithm. The algorithm presented in the paper computes the average on total processes burst time resided in the ready queue. Then, it ascertains the differences of calculated average and process burst times. In those differences, the algorithm takes the process with the smallest difference value and allots CPU to that process for one time slice. When the time slice is expired, the subsequent process from the ready queue is taken which is having the smallest difference value and it will be executed for another time slice. The algorithm assures the repetition of this procedure until all processes are finished in the ready queue. The algorithm s efficiency is evaluated with two examples. Experimental results are compared with and RR algorithm and found that the proposed algorithm exhibited better optimal scheduling. REFRENCES: [1] Shah, Syed Nasir Mehmood, Ahmad Kamil Bin Mahmood, and Alan Oxley. "Hybrid scheduling and dual queue scheduling." In Computer Science and Information Technology, 2009. ICCSIT 2009. 2nd IEEE International Conference on, pp. 539-543. IEEE, 2009. [2] Silberschatz, Abraham. "(WCS) Operating System Concepts 7th Edition Flex Format." (2005). [3] Garrido, José M., and Richard Schlesinger. Principles of modern operating systems. Jones & Bartlett Learning, 2008. [4] Das, Vinu V., Narayan C. Debnath, R. Vijayakumar, Janahanlal Stephen, Natarajan Meghanathan, Suresh Sankaranarayanan, P. M. Thankachan, Ford Lumban Gaol, and Nessy Thankachan. Information Processing and Management: International Conference on Recent Trends in Business Administration and Information Processing, BAIP 2010, Trivandrum, Kerala, India, March 26-27, 2010. Proceedings. Vol. 70. Springer Science & Business Media, 2010. [5] Dhamdhere, Dhananjay M. Operating Systems: A Concept-based Approach, 2E. Tata McGraw- Hill Education, 2006. [6] Guo, Qing-pu, and Yang Liu. "The Effect of Scheduling Discipline on CPU-MEM Load Sharing System." In Wireless Communications, Networking and Mobile Computing, 2008. WiCOM'08. 4th International Conference on, pp. 1-8. IEEE, 2008. [7] Alam, Bashir, M. N. Doja, and R. Biswas. "Improving the performance of fair share scheduling algorithm using fuzzy logic." In Proceedings of the International Conference on Advances in Computing, Communication and Control, pp. 567-570. ACM, 2009. [8] Alam, Bashir, M. N. Doja, and R. Biswas. "Finding time quantum of Round Robin CPU scheduling algorithm using Fuzzy Logic." In Computer and Electrical Engineering, 2008. ICCEE 2008. International Conference on, pp. 795-798. IEEE, 2008. [9] A. Silberschatz, P. B. Galvin, G. Gange, Operating Systems Concepts with Java, John Wiley and Sons. 6Ed 2004. [10] Matarneh, Rami J. "Self-adjustment time quantum in round robin algorithm depending on burst time of the now running processes." American Journal of Applied Sciences 6, no. 10 (2009): 1831. [11] Harwood, Aaron, and Hong Shen. "Using fundamental electrical theory for varying time quantum uni-processor scheduling." Journal of systems architecture 47, no. 2 (2001): 181-192. [12] Helmy, Tarek, and Abdelkader Dekdouk. "Burst round robin as a proportional-share scheduling algorithm." In Proceedings of The fourth IEEE- GCC Conference on Towards Techno-Industrial Innovations, pp. 424-428. 2007. [13] Kiran, RNDS S., Polinati Vinod Babu, and BB Murali Krishna. "Optimizing CPU scheduling for real time applications using meandifference round robin () algorithm." In ICT and Critical Infrastructure: Proceedings of the 48th Annual Convention of Computer Society of India-Vol I, pp. 713-721. Springer International Publishing, 2014. 56