Abstract
An optimal algorithm is presented for feasibility test and scheduling of real-time tasks where tasks are preemptable and created dynamically. Each task has an arbitrary creation time, ready time, maximum execution time, and deadline. Feasibility test and scheduling are conducted via the same algorithm. Time complexity of the algorithm is O(n) for each newly created task where n is the number of tasks. This result improves the previous result of O(n log n). It is shown that the algorithm can be used for scheduling tasks with different levels of importance. Time complexity of the algorithm for the problem is O(n\ulcorner) which improves the previous results of O(n\ulcorner log n).