International Journal of Advanced Research in Computer Science and Software Engineering

Similar documents
Design and Performance Evaluation of a New Proposed Shortest Remaining Burst Round Robin (SRBRR) Scheduling Algorithm

Revamped Round Robin Scheduling Algorithm

COMPARATIVE PERFORMANCE ANALYSIS OF MULTI-DYNAMIC TIME QUANTUM ROUND ROBIN (MDTQRR) ALGORITHM WITH ARRIVAL TIME

Journal of Global Research in Computer Science

ENHANCING CPU PERFORMANCE USING SUBCONTRARY MEAN DYNAMIC ROUND ROBIN (SMDRR) SCHEDULING ALGORITHM

Improvising Round Robin Process Scheduling through Dynamic Time Quantum Estimation

An Improved Round Robin Approach using Dynamic Time Quantum for Improving Average Waiting Time

February 2011 Page 23 of 93 ISSN

EXTRA THRESHOLD IN ROUND ROBIN ALGORITHM IN MULTIPROCESSOR SYSTEM

Dynamic Time Quantum based Round Robin CPU Scheduling Algorithm

CPU scheduling. CPU Scheduling

Efficient Dual Nature Round Robin CPU Scheduling Algorithm: A Comparative Analysis

Journal of Global Research in Computer Science

Half Life Variable Quantum Time Round Robin (HLVQTRR)

Module 5: CPU Scheduling

Chapter 6: CPU Scheduling

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

2/5/07 CSE 30341: Operating Systems Principles

ENHANCING THE CPU PERFORMANCE USING A MODIFIED MEAN- DEVIATION ROUND ROBIN SCHEDULING ALGORITHM FOR REAL TIME SYSTEMS.

CSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song

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

CS 550 Operating Systems Spring CPU scheduling I

A NEW PROPOSED DYNAMIC DUAL PROCESSOR BASED CPU SCHEDULING ALGORITHM

Determining the Optimum Time Quantum Value in Round Robin Process Scheduling Method

CPU Scheduling. CPU Scheduler

TDDI04, K. Arvidsson, IDA, Linköpings universitet CPU Scheduling. Overview: CPU Scheduling. [SGG7] Chapter 5. Basic Concepts.

Comp 204: Computer Systems and Their Implementation. Lecture 11: Scheduling cont d

CPU SCHEDULING RONG ZHENG

DETERMINING THE VARIABLE QUANTUM TIME (VQT) IN ROUND ROBIN AND IT S IMPORTANCE OVER AVERAGE QUANTUM TIME METHOD

TDDB68 Concurrent programming and operating systems. Lecture: CPU Scheduling II

Process Scheduling. Process Scheduling. CPU and I/O Bursts. CPU - I/O Burst Cycle. Variations in Bursts. Histogram of CPU Burst Times

Computing the Signal Duration to Minimize Average Waiting Time using Round Robin Algorithm

ODSA: A Novel Ordering Divisional Scheduling Algorithm for Modern Operating Systems

Real-time operating systems course. 6 Definitions Non real-time scheduling algorithms Real-time scheduling algorithm

ENHANCED ROUND ROBIN ALGORITHM FOR PROCESS SCHEDULING USING VARYING QUANTUM PRECISION

CPU Scheduling. Heechul Yun

ENHANCING THE CPU PERFORMANCE USING A MODIFIED MEAN- DEVIATION ROUND ROBIN SCHEDULING ALGORITHM FOR REAL TIME SYSTEMS

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

UC Santa Barbara. Operating Systems. Christopher Kruegel Department of Computer Science UC Santa Barbara

Simulation of Process Scheduling Algorithms

Scheduling. Uwe R. Zimmer & Alistair Rendell The Australian National University

Last class: Today: Threads. CPU Scheduling

CSE 380 Computer Operating Systems

Improved Deadline Monotonic Scheduling With Dynamic and Intelligent Time Slice for Real-time Systems

CPU Scheduling Exercises

CHAPTER 5 - PROCESS SCHEDULING

A new Hybridized Multilevel Feedback Queue Scheduling with Intelligent Time Slice and its Performance Analysis

CS 370. FCFS, SJF and Round Robin. Yashwanth Virupaksha and Abhishek Yeluri

Season Finale: Which one is better?

Scheduling IoT on to the Cloud : A New Algorithm

LSN 15 Processor Scheduling

process arrival time CPU burst time priority p1 0ms 25ms 3 p2 1ms 9ms 1 p3 20ms 14ms 4 p4 32ms 4ms 2

Lecture 6. Real-Time Systems. Dynamic Priority Scheduling

D Praveen Kumar et al, / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 5 (5), 2014,

ANALYSIS AND TESTING OF DIFFERENT TIME QUANTUM FOR ROUND ROBIN ALGORITHM

Real-Time Systems. Event-Driven Scheduling

Real-Time Systems. Event-Driven Scheduling

Aperiodic Task Scheduling

Research Article Designing of Vague Logic Based 2-Layered Framework for CPU Scheduler

Task Models and Scheduling

Lecture 13. Real-Time Scheduling. Daniel Kästner AbsInt GmbH 2013

How to deal with uncertainties and dynamicity?

Clock-driven scheduling

Embedded Systems 14. Overview of embedded systems design

Embedded Systems Development

Analysis of Software Artifacts

Networked Embedded Systems WS 2016/17

Lecture Note #6: More on Task Scheduling EECS 571 Principles of Real-Time Embedded Systems Kang G. Shin EECS Department University of Michigan

3. Scheduling issues. Common approaches 3. Common approaches 1. Preemption vs. non preemption. Common approaches 2. Further definitions

Introduction to Queueing Theory

CIS 4930/6930: Principles of Cyber-Physical Systems

Performance Metrics for Computer Systems. CASS 2018 Lavanya Ramapantulu

Real-Time Scheduling and Resource Management

Resource Sharing in an Enhanced Rate-Based Execution Model

Real-time Scheduling of Periodic Tasks (1) Advanced Operating Systems Lecture 2

Embedded Systems 15. REVIEW: Aperiodic scheduling. C i J i 0 a i s i f i d i

Introduction to Queueing Theory

A Utilization Bound for Aperiodic Tasks and Priority Driven Scheduling

EECS 571 Principles of Real-Time Embedded Systems. Lecture Note #7: More on Uniprocessor Scheduling

EDF Feasibility and Hardware Accelerators

Introduction to Queueing Theory

Analysis of Round-Robin Implementations of Processor Sharing, Including Overhead

Multi-Objective Scheduling Using Rule Based Approach

Process Scheduling for RTS. RTS Scheduling Approach. Cyclic Executive Approach

Scheduling Slack Time in Fixed Priority Pre-emptive Systems

PBS: A Unified Priority-Based CPU Scheduler

Real-Time Systems. LS 12, TU Dortmund

Shared on QualifyGate.com

Scheduling Algorithms for Multiprogramming in a Hard Realtime Environment

Real-Time and Embedded Systems (M) Lecture 5

Optimal Utilization Bounds for the Fixed-priority Scheduling of Periodic Task Systems on Identical Multiprocessors. Sanjoy K.

M/G/1 and Priority Queueing

CS 374: Algorithms & Models of Computation, Spring 2017 Greedy Algorithms Lecture 19 April 4, 2017 Chandra Chekuri (UIUC) CS374 1 Spring / 1

Andrew Morton University of Waterloo Canada

Competitive Analysis of M/GI/1 Queueing Policies

Convolution Algorithm

Real-Time Scheduling. Real Time Operating Systems and Middleware. Luca Abeni

Proportional Share Resource Allocation Outline. Proportional Share Resource Allocation Concept

SPT is Optimally Competitive for Uniprocessor Flow

Operating Systems. VII. Synchronization

Transcription:

Volume 2, Issue 11, November 2012 ISSN: 2277 128X International Journal of Advanced Research in Computer Science and Software Engineering Research Paper Available online at: www.ijarcsse.com A Best possible Time quantum for Improving Shortest Remaining Burst Round Robin (SRBRR) Algorithm P.Surendra Varma * Associate Professor Department of Computer Science & Engineering NRI Institute of Technology Vijayawada, Andhra Pradesh, India Abstract Round Robin (RR) performs optimally in timeshared systems because each process is given an equal amount of static time quantum. But the effectiveness of RR algorithm solely depends upon the choice of time quantum. I have made a comprehensive study and analysis of RR algorithm and SRBRR algorithm. I have proposed an improved version of SRBRR (Shortest Remaining Burst Round Robin) by assigning the processor to processes with shortest remaining burst in round robin manner using the best possible time quantum. Time quantum is computed with the help of median and highest burst time. My experimental analysis shows that ISRBRR performs better than RR algorithm and SRBRR in terms of reducing the number of context switches, average waiting time and average turnaround time. Keywords Operating System, Scheduling Algorithm, Round Robin, Context switch, Waiting time, Turnaround time. I. INTRODUCTION A process is an instance of a computer program that is being executed. It includes the current values of the program counter, registers, and variables. The subtle difference between a process and a program is that the program is a group of instructions whereas the process is the activity.the processes waiting to be assigned to a processor are put in a queue called ready queue. The time for which a process holds the CPU is known as burst time. Arrival Time is the time at which a process arrives at the ready queue. The interval from the time of submission of a process to the time of completion is the turnaround time.. Waiting time is the amount of time a process has been waiting in the ready queue. The number of times CPU switches from one process to another is known as context switch. The optimal scheduling algorithm will have minimum waiting time, minimum turnaround time and minimum number of context switches. II. PRELIMINARIES Basic Scheduling Algorithms First Come First Serve (FCFS) In this algorithm, the process to be selected is the process which requests the processor first. This is the process whose PCB is at the head of the ready queue. Contrary to its simplicity, its performance may often be poor compared to other algorithms. FCFS may cause processes with short processor bursts to wait for a long time. If one process with a long processor burst gets the processor, all the others will wait for it to release it and the ready queue will be filled very much. This is called the convoy effect. Shortest Job First (SJF) In this strategy the scheduler arranges processes with the Burst times in the ready queue, so that the process with low burst time is scheduled first. If two processes having same burst time and arrival time, then FCFS procedure is followed. Shortest Remaining Time First (SRTF) This is same as the SJF with pre emption, which small modification. For scheduling the jobs system need to consider the remaining burst time of the job which is presently executed by the CPU also along with the burst time of the jobs present in the ready queue. Priority Scheduling Algorithm It provides the priority to each process and selects the highest priority process from the ready queue. A priority scheduling algorithm can leave some low-priority processes in the ready queue indefinitely. If the system is heavily loaded, it is a great 2012, IJARCSSE All Rights Reserved Page 228

probability that there is a higher priority process to grab the processor. This is called the starvation problem. One solution for the starvation problem might be to gradually increase the priority of processes that stay in the system for a long time. Round robin Scheduling Algorithm Round Robin (RR) is one of the oldest, simplest, and fairest and most widely used scheduling algorithms, designed especially for time-sharing systems. Here every process has equal priority and is given a time quantum after which the process is preempted. The OS using RRS, takes the first process from the ready queue, sets a timer to interrupt after one time quantum and gives the processor to that process. If the process has a processor burst time smaller than the time quantum, then it releases the processor voluntarily, either by terminating or by issuing an I/O request. The OS then proceed with the next process in the ready queue. On the other hand, if the process has a processor burst time greater than the time quantum, then the timer will go off after one time quantum expires, and it interrupts (preempts) the current process and puts its PCB to the end of the ready queue. Any CPU scheduling algorithm relies on the following criteria. They are: 1) Processor Utilization: The ratio of busy time of the processor to the total time passes for processes to finish. We would like to keep the processor as busy as possible. Processor Utilization = (Processor buy time) / (Processor busy time + Processor idle time) 2)Throughput: The measure of work done in a unit time interval. Throughput = (Number of processes completed) / (Time Unit) 3)Turnaround Time (tat): The sum of time spent waiting to get into the ready queue, Execution time and I/O time. tat = t(process completed) t(process submitted) 4)Waiting Time (wt): Time spent in ready queue. Processor scheduling algorithms only affect the time spent waiting in the ready queue. So, considering only waiting time instead of turnaround time is generally sufficient. 5)Response Time (rt): The amount of time it takes to start responding to a request. This criterion is important for interactive systems. rt = t(first response) t(submission of request) We, normally, want to maximize the processor utilization and throughput, and minimize tat, wt, and rt. However, sometimes other combinations may be required depending on to processes. III. RELATED WORK In the last few years different approaches are used to increase the performance of Round Robin scheduling like Adaptive Round Robin Scheduling using Shortest Burst Approach Based on Smart Time Slice[1], Multi-Dynamic time Quantum Round Robin (MDTQRR)[5].Min-Max Round Robin (MMRR)[2], Self-Adjustment Time Quantum in Round Robin (SARR)[10], Dynamic Quantum with Re-adjusted Round Robin (DQRRR)[11],Average Max Round Robin Algorithm (AMRR)[8]. In this paper also Efforts have been made to modify SRBRR in order to give better turnaround time, average waiting time and minimize context switches. IV. Proposed Algorithm The proposed algorithm works as follows: 1. All the processes present in ready queue are sorted in ascending order. 2. While (ready queue! = NULL) TQ = Ceil (sqrt (median * highest Burst time)) 3. Assign TQ to process Pi ->TQ 2012, IJARCSSE All Rights Reserved Page 229

4. If (i<n) then go to step 3 5. If a new process is arrived, Update the counter n and go to step1 End of while 6. Average waiting time, average turnaround time and Number of context switches are calculated. 7. End FLOWCHART V. Experiments & Results A. Assumptions All experiments are assumed to be performed in uniprocessor environment and all the processes are independent from each other. Attributes like burst time and priority are known prior to submission of process. All processes are CPU bound. No process is I/O bound. Processes with same arrival time are scheduled. B. Illustration and Results Case-I : Let us assume five processes, with increasing burst time (P1 = 13, P2 = 35, P 3 = 46, P4 = 63, p5= 97) as shown in TABLE. 2012, IJARCSSE All Rights Reserved Page 230

Process Burst Time P1 13 P2 35 P3 46 P4 63 P5 97 Now, as per the algorithm Time Quantum is calculated as follows TQ = Ceil (sqrt (median * highest Burst time)) TQ = Ceil (sqrt(46 * 97)) = 67 A. P1 B. P2 C. P3 D. P4 E. P5 F. P5 0 13 48 94 157 224 254 Number of Context Switches = 5 Average Waiting Time = (0+13+48+94+157) / 5 = 62.4 Average Turn around Time = (13+48+94+157+254) / 5 = 113.2 Algorithm Time Quantum Avg.TAT Avg.WT CS RR 25 148.2 97.4 11 SRBRR 46 122.4 71.6 7 ISRBRR 72 113.2 62.4 5 Table I: Comparison between RR, SRBRR and Proposed algorithm (case I) 160 140 120 100 80 60 40 20 0 Number of context switches Average waiting time Average Turn around time RR SRBRR ISRBRR 2012, IJARCSSE All Rights Reserved Page 231

Case II : Let us assume five processes arriving at time = 0, with decreasing burst time (P1 = 86, P2 =53, P 3 = 32, P4= 21, p5= 9) as shown in TABLE Process Burst Time P1 86 P2 53 P3 32 P4 21 P5 9 Now, TQ can be calculated as follows : TQ = Ceil (sqrt (median * highest Burst time)) TQ = Ceil (sqrt( 32 * 86)) = 53 G. P5 H. P4 I. P3 J. P2 K. P1 L. P1 0 9 30 62 115 168 201 Number of Context Switches = 5 Average Waiting Time = (0+9+30+62+115) / 5 = 43.2 Average Turnaround Time = (9+30+62+115+201) / 5 = 83.4 Algorithm Time Quantum Avg.TAT Avg.WT CS RR 25 150.8 110.5 10 SRBRR 32 89.8 49.6 7 ISRBRR 59 83.4 43.2 5 Table II: Comparison between RR, SRBRR and Proposed algorithm (case II) 2012, IJARCSSE All Rights Reserved Page 232

200 150 100 50 0 Number of Average waiting context switches time Average turnaround time RR SRBRR ISRBRR Case-III : Let us Assume five processes arriving at time = 0, with random burst time (P1 = 54, P2 = 99, P 3 = 5, P 4 = 27, p5= 32) as shown in TABLE Process Burst Time P1 54 P2 99 P3 5 P4 27 P5 32 Now, TQ can be calculated as follows : TQ = Ceil (sqrt (median * highest Burst time)) TQ = Ceil(sqrt(32*99)) = 57 M. P3 N. P4 O. P5 P. P1 Q. P2 R. P2 0 5 32 64 118 175 217 Number of Context Switches = 5 Average Waiting Time = (0+5+32+64+118) / 5 = 43.8 Average Turnaround Time = (5+32+64+118+217) / 5 = 87.2 Algorithm Time Quantum Avg.TAT Avg.WT CS RR 25 152.2 108.8 11 SRBRR 32 93.6 50.2 7 ISRBRR 66 87.2 43.8 5 2012, IJARCSSE All Rights Reserved Page 233

Table III: Comparison between RR, SRBRR and Proposed algorithm (case III) 160 140 120 100 80 60 40 20 0 Number of context switches Average waiting time Average turnaround time RR SRBRR ISRBRR C. Implementation The algorithm is implemented using C language and its code is as follows: Source Code #include<stdio.h> #include<conio.h> #include<math.h> int st[10]; int get_tq(int b[],int s) int i,j,maxbt,tmp,hbt,median; float k,l,m; for(i=0;i<s;i++) for(j=i+1;j<s;j++) if (b[i]>b[j]) tmp=b[i]; b[i]=b[j]; b[j]=tmp; hbt=b[i-1]; median=b[i/2]; for(i=0;i<s;i++) st[i]=b[i]; l=(float)hbt; m=(float)median; k=sqrt((l*m)); return(ceil(k)); void main() int bt[10],wt[10],tat[10],n,tq; int i,count=0,swt=0,stat=0,temp,sq=0; float awt=0.0,atat=0.0; 2012, IJARCSSE All Rights Reserved Page 234

clrscr(); printf("enter number of processes:"); scanf("%d",&n); printf("enter burst time for sequences:"); for(i=0;i<n;i++) scanf("%d",&bt[i]); st[i]=bt[i]; tq=get_tq(st,n); printf("\ntime quantum is computed by ceil((highestbt+median)/2) = %d\n",tq); while(1) for(i=0,count=0;i<n;i++) temp=tq; if(st[i]==0) count++; continue; if(st[i]>tq) st[i]=st[i]-tq; else if(st[i]>=0) temp=st[i]; st[i]=0; sq=sq+temp; tat[i]=sq; if(n==count) break; for(i=0;i<n;i++) wt[i]=tat[i]-bt[i]; swt=swt+wt[i]; stat=stat+tat[i]; awt=(float)swt/n; atat=(float)stat/n; //printf("process_no\t Burst time\t Wait time\t Turn around time\t"); //for(i=0;i<n;i++) //printf("%d\t %d\t %d\t %d\t",i+1,bt[i],wt[i],tat[i]); printf("\navg waiting time is %f\navg turn around time is %f",awt,atat); getch(); OUTPUT Enter number of processes:5 Enter burst time for sequences: 13 35 46 63 97 Time quantum is computed by ceil(sqrt(highestbt*median)) = 67 2012, IJARCSSE All Rights Reserved Page 235

Avg waiting time is 62.400002 Avg turn around time is 113.199997 D. Simulation and Screen shots Turbo C++ is used in order to simulate the source code. Here are some screen shots of simulation process. Output simulation for case-i 2012, IJARCSSE All Rights Reserved Page 236

VI. Conclusions From the above comparisons i can conclude that the proposed algorithm is performing better than the static RR algorithm and SRBRR algorithm in terms of average waiting time, average turnaround time and number of context switches. In future work, processes at different arrival times can be considered for the proposed algorithm. REFERENCES [1] Sarojhiranwal and D.r. K.C.Roy Adaptive Round Robin Scheduling using Shortest Burst Approach Based on Smart Time Slice.volume 2,issue 3. [2] Sanjay Kumar Panda and Saurav Kumar Bhoi, An Effective Round Robin Algorithm using Min-Max Dispersion Measure ISSN : 0975-3397,Vol. 4 No. 01, January 2012. [3] Tanebaun, A.S., 2008 Modern Operating Systems. 3rd Edn., Prentice Hall, ISBN: 13:9780136006633, pp: 1104. [4] Silberschatz, A., P.B. Galvin and G. Gagne, 2008 Operating Systems Concepts. 7th Edn., John Wiley and Sons, USA., ISBN: 13: 978-0471694663, pp: 944. [5] H. S. Behera, Rakesh Mohanty, Sabyasachi Sahu and Sourav Kumar Bhoi. Comparative performance analysis of multi-dynamic time quantum round robin (mdtqrr) algorithm with arrival time, ISSN : 0976-5166, Vol. 2, No. 2, Apr- May 2011. [6] Tarek Helmy, Abdelkader Dekdouk Burst Round Robin: As a Proportional-Share Scheduling Algorithm, IEEE Proceedings of the fourth IEEE-GCC Conference on towards Techno-Industrial Innovations, pp. 424-428, 11-14 November,2007 [7] Yaashuwanth.C & R. Ramesh Inteligent time slice for round robin in real time operating system, IJRRAS 2 (2), February 2010. [8] Pallab banerjee, probal banerjee, shweta sonali dhal, Comparative Performance Analysis of Average Max Round Robin Scheduling Algorithm (AMRR) using Dynamic Time Quantum with Round Robin Scheduling Algorithm using static Time Quantum,IJITEE,ISSN: 2278-3075, Volume-1, Issue-3, August 2012. [9] J. Nieh, C. Vaill and H. Zhong, Virtual-Time Round-Robin: An O(1) Proportional Share Scheduler, Proceedings of the USENIX [10] R. J. Matarneh, Seif-Adjustment Time Quantum in Round Robin Algorithm Depending on Burst Time of the Now Running Proceses, American Journal of Applied Sciences 6 (10), pp. 1831-1837, 2009. [11] H. S. Behera, R. Mohanty, and D. Nayak, A New Proposed Dynamic Quantum with Re-Adjusted Round Robin Scheduling Algorithm and Its Performance Analysis, vol. 5, no. 5, pp. 10-15, August 2010. [12] A. Bhunia, Enhancing the Performance of Feedback Scheduling, IJCA, vol. 18, no. 4, pp. 11-16, March 2011. [13] Prof. Rakesh Mohanty, Prof. H. S. Behera, Khusbu Patwari, Manas Ranjan Das, Monisha Dash,Sudhashree Design and Performance Evaluation of a New Proposed Shortest Remaining Burst RoundRobin (SRBRR) Scheduling Algorithm, Am. J. Applied Sci., 6 (10): 1831-1837, 2009. 2012, IJARCSSE All Rights Reserved Page 237