An Efficient Dynamic Scheduling Algorithm for Periodic Tasks in Real-Time Systems Using Dynamic Average Estimation Ahmed Alsheikhy 1 , Reda Ammar 1 , Raafat Elfouly 2 , Mosleh Alharthi 3 and Abdulrahman Alshegaifi 1 1 Computer Science and Engineering Dept. University of Connecticut 2 Computer Engineering Dept. Faculty of Engineering, Cairo University 3 Electrical Engineering Dept. Faculty of Engineering, Taif University 1 {ahmed, reda}@engr.uconn.edu 2 {relfouly@eng.cu.edu.eg} 3 {m.harthi@tu.edu.sa} 1 {Abdulrahman.alshegaifi@uconn.edu} AbstractReal-time embedded systems have become widely used in many fields such as control, monitoring and aviation. They perform several tasks under strict time constraints. In such systems, deadline miss may lead to catastrophic results so that all jobs need to be scheduled appropriately to ensure that they meet their deadline times. This paper presents an efficient dynamic scheduling algorithm during run-time to schedule periodic tasks in multiprocessor environments and uniprocessor as well using a dynamic average estimation. Dynamic average estimation refers to changing in different probability distributions when a task is added or removed from them. It is not always available a value of Worst-Case Execution Time (WCET) in many real-time applications such as multimedia where data has a great variation. The proposed approach selects which task or a set of tasks must be picked up for execution. A simulation system was developed to show validation of the proposed approach. Index TermsReal-time embedded systems, scheduling algorithm, time constraints, deadline, performance, periodic tasks, probability distribution, multiprocessor, run-time, efficient dynamic algorithm, stochastic tasks I. INTRODUCTION Choosing or scheduling which job(s) must be selected first and its or their parameters play a significant influence on system performance. The main objectives of scheduling in real-time systems are to 1) decide which job is selected and run from ready queue and assigned to CPU and 2) ensure that all processes meet their deadlines [1,2]. Scheduling method affects CPU performance since it determines the CPU and resources utilizations [2]. Two categories of real-time systems exist nowadays and can be summarized as follows: 1) Hard real-time systems in which deadline miss means fail and could lead to a disaster result and 2) Soft real-time systems where deadline miss is tolerated and they still perform their functions. Scheduling can be defined as a method that specifies which task or a set of tasks is assigned to resources in order to complete a desired job. Many real-time applications such as information processing, weather prediction modeling and even image processing require a good processing capabilities to perform their functions which implies that a good scheduling policy must be existed in order to ensure that all tasks meet their deadlines [1]. In multiprocessor environments, when multiple applications run and compete for resources, providing an efficient CPU time for each tasks is not easy task [3,4,5]. They require a priori known of advanced execution time which is impractical in many situations [4,6]. We assume that all processes run-time probability density function (pdf) distributions are well known or can be evaluated [3]. It is required to schedule different tasks on different processors which is influenced by the remaining execution time [3]. Using remaining execution time to develop a method to schedule periodic tasks on multiprocessor environments based on different probability distributions (pdf) is the motivation in this research. In real-time systems, many tasks can be considered as stochastic ones, which are defined as collection of random variables representing the evaluation of a system of random values over time with large variability [3,7,8]; it is impractical to use WCET in scheduling periodic tasks with high variation in coefficient of variance C 2 ; which can be seen as relative standard deviation (RSD) [9]. Static and dynamic methods for scheduling algorithms exist these days. In each category, there are two schemes of algorithms which are 1. Preemptive approach: where a task is blocked by a higher priority process and 2. Non preemptive approach: where the task completes its execution time even if a higher priority process has arrived [3,4]. A scheduling policy can be characterized by several factors which are summarized as follows: A. Do all processes meet their deadlines?, B. CPU Utilization: the percentage of the CPU being busy, C. Response time for every job and D. Fairness: which is dividing the CPU time equally among all available jobs and load balancing which is dividing the load equally among all processors/cores . Multiple algorithms exist which can be summarized as follows: 1) Rate Monotonic (RM): is static type for periodic tasks since each process is assigned a priority based on its request rate. The higher request is the higher priority is. However, that priority does not change during run-time and that is why it is called static [9], 2) Deadline Monotonic (DM): is a generalization version of rate monotonic. Their concepts are almost the same; however, the difference is that in deadline monotonic a priority assigned to each process is inversely proportional to its deadline. So a process with shortest deadline gets highest priority and assigned first to the resources [3,9], 3) Earliest Deadline First (EDF): a process with shortest deadline time gets its turn first since it has a highest priority among all