Competitive Online Scheduling with Fixed Number of Queues Richard Bryann L. Chua Department of Physical Sciences and Mathematics University of the Philippines Manila Padre Faura St., Ermita, Manila (632)5265858 rlchua@up.edu.ph Jaime D.L. Caro Department of Computer Science University of the Philippines Diliman Diliman, Quezon City (632)9202080 jaime.caro@up.edu.ph One of the complex parts of an operating system design is CPU scheduling, where the OS schedules a sequence of arriving jobs to use the CPU, without knowledge of the time and number of arriving jobs and their execution times. One of the measures of performance of a scheduling algorithm is the average flow time. For a long time, most major operating systems, like Windows and UNIX used a scheduling algorithm based on the Multilevel Feedback scheduling algorithm. In this research, we present the Randomized Multilevel Feedback 2 (RMLF2) scheduling algorithm, which is a version of the RMLF algorithm proposed by Kalyanasundaram and Pruhs, and show that it has a competitive ratio of ( ) n O ln in terms of minimizing flow time against an online adaptive adversary. Since this obtains the ( ) n log lower bound for any randomized scheduling algorithm, it has a tight competitive ratio of ( ) n ln Θ . randomized multilevel feedback, scheduling, competitive analysis, online algorithm, randomized algorithm CPU scheduling is essential in any multiprogramming systems. In such system, processes arrive over time and the processor should decide which process to run, in ways that meet system objectives, such as response time and throughput [1]. In [13], Motwani, et. al. complained that many early researches in scheduling have been concerned with clairvoyant scheduling, where the characteristics of a job, like its release time and execution time, are known beforehand. Many scheduling algorithms were created from these researches, including the shortest remaining processing time (SRPT), which is considered the most optimal scheduling algorithm that minimizes the total flow time (see [5, 9]). The clairvoyant approach is not applicable in reality because the nature of the scheduling problems encountered is nonclairvoyant, meaning it is impossible to have a priori knowledge of the running time of processes and the time that they will arrive. Since the operating systems does not know the running time of the processes, it is not possible to obtain an optimal average flow time. Hence, in nonclairvoyant scheduling analysis, one uses the method of competitive analysis. In competitive analysis, the performance of a nonclairvoyant scheduler is compared to that of an optimal clairvoyant scheduler for each set of input processes. The nonclairvoyant scheduler is compared to that of an optimal clairvoyant scheduler for each set of input processes. The nonclairvoyant algorithm is measured in terms of its competitive ratio, c n , which is defined as ) ( ) ( max J C J C c OPT A J n = where C A (J) denotes the cost of the schedule produced by the nonclairvoyant algorithm A on input J, C OPT (J) denotes the cost of the optimal schedule produced by the optimal clairvoyant algorithm OPT, and the maximum is over all inputs J with n processes. In [8], Kalyanasundaram and Pruhs interpreted the competitive ratio as the payoff to a game played between an online nonclairvoyant algorithm and an all8powerful malevolent adversary OPT that specifies the input J, and schedules J optimally. In [9], Kalyanasundaram and Pruhs proposed the Randomized Multilevel Feedback (RMLF) scheduling algorithm, which is a variant of the Multilevel Feedback (MLF) scheduling algorithm used in Windows and UNIX, and showed that it has a competitive ratio of O(log n log log n), where n is the number of jobs. Their result have been obtained with an RMLF algorithm where the highest queue is determined by the length of the longest job. However, in most operating systems, the number of queues is fixed. In this research, we propose a version of RMLF, where the number of queues is fixed, and determine its competitive ratio. In [16], Pruhs et. al. classified scheduling algorithms into online and offline algorithm. In an online algorithm, the algorithm does not have access to the entire input sequence, as it makes its decision. On the other hand, an offline algorithm has access to the entire input sequence. Another classification used by Pruhs et. al. in [16] is whether an algorithm is clairvoyant or nonclairvoyant. A nonclairvoyant algorithm has no knowledge of the characteristics of the running jobs while a clairvoyant algorithm can gain knowledge of the characteristics of the running job. The most widely accepted measure of the performance of a scheduling algorithm is the flow time – the time spent by the job in the system between its release and completion, that is i i i r C F − =