Volume 3, No. 3, May-June 2012 International Journal of Advanced Research in Computer Science RESEARCH PAPER Available Online at www.ijarcs.info © 2010, IJARCS All Rights Reserved 186 ISSN No. 0976-5697 A Priority Based Dynamic Round Robin with Deadline (PBDRRD) Scheduling Algorithm for Hard Real Time Operating System Rakesh Mohanty*, Shekhar Chandra Pradhan, Swarup Ranjan Behera Department of Computer Science and Engineering Veer Surendra Sai University of Technology Burla, Odisha, India rakesh.iitmphd@gmail.com, shekhar.pradhan0@gmail.com, swaruprj.vssut@gmail.com, Abstract: In this paper, we have made a comprehensive study of variants of Round Robin (RR) scheduling algorithm existing in the literature for Real Time Operating System (RTOS). As per our knowledge there is no known efficient RR scheduling algorithm for Hard RTOS. Our study has been focused on a recently developed algorithm, known as Priority Based Dynamic Round Robin (PBDRR) scheduling algorithm. We have proposed a novel variant of PBDRR algorithm using deadline, which we call as PBDRRD algorithm. This algorithm can be efficiently used for Hard RTOS. We have made comparative performance evaluation of two algorithms i.e. PBDRR and PBDRRD by considering three cases of the input data set. We have computed the average turnaround time, average waiting time and number of context switches for both the algorithms using Gantt chart. Our experimental results show that performance of PBDRRD algorithm is better than that of PBDRR algorithm in all the three cases. Keywords: Real Time Operating System, Scheduling, Round Robin, Dynamic Time Quantum, Intelligence Time Slice, Deadline. I. INTRODUCTION An operating system is a program that effectively and efficiently manages the hardware and software resources of a computer system. A program in execution is called a process. Real Time Operating System (RTOS) is a special type of operating system in which a fixed time frame is allotted for the execution of a process. RTOS finds applications in fire alarm system, flight control system, embedded computing, space based defense systems, control of laboratory experiments, process control in industrial plants, robotics, air traffic control, telecommunications, military command and control systems. A. Real Time Operating System: RTOS can be classified into three types such as - Hard RTOS, Soft RTOS and Firm RTOS. In Hard RTOS, the processes must meet their deadlines strictly before completion of execution, otherwise the system will fail. But in Soft RTOS, each process is associated with a deadline with some relaxation. In this case, the system may not fail even if the deadline is not met, but the system’s quality of services is degraded. In Firm RTOS, a low probability of missing a deadline can be accepted without the consequence of system failure. There are four important characteristics of RTOS such as determinism, responsiveness, user control and reliability. Determinism specifies that operations are to be performed at fixed predetermined times or within predetermined time intervals. Responsiveness is the time duration of servicing an interrupt by the operating system after an acknowledgment. It includes amount of time to begin execution of the interrupt and the amount of time to perform the interrupt. User control of an RTOS may involve activities like specifying priority and specifying paging. The RTOS must be reliable in the sense that it should not fail in adverse conditions. Scheduling of process in an RTOS involves act of selecting the order of allocation of Central Processing Unit (CPU) to the processes which are to be executed. The scheduler is a component of operating system that has to schedule the processes in such a way that they can finish their execution before their respective deadlines. Scheduling algorithms are designed to efficiently schedule the processes for execution. Scheduling algorithms can be either pre-emptive or non-preemptive. In a pre-emptive algorithm, a process is temporarily interrupted during execution and CPU is allocated to another process. In a non- preemptive algorithm a process cannot be interrupted until it completes its execution. Few basic terminologies and definitions related to operating system of scheduling are presented below. B. Basic Terminologies: Burst Time (T B ) is the amount of CPU time a process independently requires to complete its execution. Ready queue is a queue where all the processes are entered before allocation of CPU. Waiting Time (WT) is the amount of time that a process spends waiting in the ready queue before execution. Turnaround Time (TAT) is the interval between the submission of process and its time of completion. Context Switch (CS) is the process of switching the CPU between two processes upon interrupt request by performing a state save of current process and a state restore of other. Deadline (D) is the strict time constraint before which a process has to finish its execution. C. Scheduling Algorithms for RTOS: A broad classification of RTOS scheduling algorithms has been presented in Figure 1.