On-line Scheduling Algorithm for the Gravitational Task Model Raphael Guerra, Gerhard Fohler Chair of Real Time Systems Technische Universität Kaiserslautern, Germany {guerra,fohler}@eit.uni-kl.de Abstract Some applications for real-time scheduling have target demands in addition to the commonly used starttime and deadline constraints: a task should be executed at a target point in time for maximum utility, but can execute around this point, albeit at lower utility. Examples for such appli- cations include control and media processing. In this paper, we present a scheduling algorithm for the gravitational task model that we proposed in [1], [2]. This model allows tasks to express their utility as a function of the point of execution and the target point. The proposed scheduler is divided into 2 phases: ordering and timing. The former uses a heuristic to order the jobs in the ready queue and the latter schedules the execution based on the equilibrium [1], [2]. The new ordering heuristic accounts for both acceptance ratio and utility accrual, hence achieving better results than the scheduler proposed in [1], [2]. Besides, the scheduler proposed here uses a heuristic for the ordering phase of complexity O(n × log(n)) and a timing phase of complexity O(n). These complexities represent a significant reduction compared to previous work. Moreover, this paper contains an analysis of the com- plexity of the proposed scheduler and an evaluation through simulation. 1. Introduction Real-time systems are traditionally defined as computing systems that must react within precise time constraints to events in the environment to provide correct behavior [3]. Therefore, most real-time schedulers were developed having deadlines as a primary concern. Some applications, however, have target sensitive constraints: their jobs have target points at which execution results in highest utility; the utility de- grades as a function of the deviation from this point. Simply meeting the deadlines does not maximize the utility of the system, although it assures its temporally correct behavior. Examples for such applications include media processing and control. In media processing moving the display of a frame around its desired point in time reduces the perceived The work presented in this paper has been supported in part by the EU IST project FRESCOR (FP6/2005/IST/5-034026) quality of the video stream, but is preferable to not showing the frame at all. In control, ideally sampling and actuation should be executed at their target points. However, shifting them a little bit for the sake of feasibility can be acceptable, provided that the system response remains within bounded limits. The gravitational task model, which we presented in [1], [2] allows a task to express an execution window for feasibil- ity, a target point where its utility is maximized, importance, and utility decay as a function of its deviation from its target point. In this model, tasks are considered as massive bobs hanging on a pendulum: a single task, left to itself, will execute at the bottom, the target point. If a force, such as the weight of other tasks, is applied, it can be shifted around this point. The compromise that maximizes the accrued utility of the system for task’s instances (henceforth called jobs) with conflicting needs is called equilibrium. An approximation to this compromise is solved with linear complexity based on the equilibrium of physical pendulums. In [1], [2] we presented the equilibrium and showed its applicability with a simple adhoc scheduler as proof of concept. This scheduler was divided into 2 phases, ordering and timing, both with complexity O(n 2 ). In this paper we propose an on-line scheduling algorithm specifically for the gravitational task model with complexity O(n × log(n)) for the ordering phase and O(n) for timing. The ordering is a NP-hard problem and severely limits the acceptance ratio and the maximum utility that can be accrued. Therefore, we solve it with a low complexity heuristic that can account for both acceptance ratio and utility accrual. It places jobs with higher utility density closer to their target points. The utility density is a job parameter that represents how much utility a job accrues per unit of execution. The timing phase schedules the execution of jobs based on the equilibrium. The complexity decrease achieved in both phases is due to a novel method for equilibrium recomputations that accounts for idle periods in the schedule. This scheduler achieves higher acceptance ratio and utility accrual than the scheduling example proposed in [1], [2], at the same time decreasing the complexity. Moreover, the complexities of the ordering and timing phases presented here are lower than in any other utility aware schedulers that are based in different task models. This paper brings a complexity study of the proposed scheduler and simulation