RTEMS Logo

RTEMS 4.6.5 On-Line Library


Rate Monotonic Manager First Deadline Rule Example

PREV UP NEXT Bookshelf RTEMS C User's Guide

19.2.4.5: First Deadline Rule Example

The First Deadline Rule can ensure schedulability even when the Processor Utilization Rule fails. The example below is a modification of the Processor Utilization Rule example where task execution time has been increased from 15 to 25 units. The following table details the RMS priority, period, execution time, and processor utilization for each task:

Task RMS Priority Period Execution Time Processor Utilization
1 High 100 25 0.25
2 Medium 200 50 0.25
3 Low 300 100 0.33

The total processor utilization for the modified task set is 0.83 which is above the upper bound of 3 * (2(1/3) - 1), or 0.779, imposed by the Processor Utilization Rule. Therefore, this task set is not guaranteed to be schedulable using RMS. However, the First Deadline Rule can guarantee the schedulability of this task set. This rule calls for one to examine each occurrence of deadline until either all tasks have met their deadline or one task failed to meet its first deadline. The following table details the time of each deadline occurrence, the maximum number of times each task may have run, the total execution time, and whether all the deadlines have been met.

Deadline Time Task 1 Task 2 Task 3 Total Execution Time All Deadlines Met?
100 1 1 1 25 + 50 + 100 = 175 NO
200 2 1 1 50 + 50 + 100 = 175 YES

The key to this analysis is to recognize when each task will execute. For example at time 100, task 1 must have met its first deadline, but tasks 2 and 3 may also have begun execution. In this example, at time 100 tasks 1 and 2 have completed execution and thus have met their first deadline. Tasks 1 and 2 have used (25 + 50) = 75 time units, leaving (100 - 75) = 25 time units for task 3 to begin. Because task 3 takes 100 ticks to execute, it will not have completed execution at time 100. Thus at time 100, all of the tasks except task 3 have met their first deadline.

At time 200, task 1 must have met its second deadline and task 2 its first deadline. As a result, of the first 200 time units, task 1 uses (2 * 25) = 50 and task 2 uses 50, leaving (200 - 100) time units for task 3. Task 3 requires 100 time units to execute, thus it will have completed execution at time 200. Thus, all of the tasks have met their first deadlines at time 200, and the task set is schedulable using the First Deadline Rule.


PREV UP NEXT Bookshelf RTEMS C User's Guide

Copyright © 1988-2004 OAR Corporation