Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

An interesting technique called rate monotonic scheduling (RMS) assigns task priorities based on how often tasks execute. Simply put, tasks with the highest rate of execution are given the highest priority. However, RMS makes a number of assumptions, including:

  • All tasks are periodic (they occur at regular intervals).
  • Tasks do not synchronize with one another, share resources, or exchange data.
  • The CPU must always execute the highest priority task that is ready-to-run. In other words, preemptive scheduling must be used.

Given a set of n tasks that are assigned RMS priorities, the basic RMS theorem states that all task hard real-time deadlines are always met if the following inequality holds true:

Image RemovedImage Added

Where Ei corresponds to the maximum execution time of task i, and Ti corresponds to the execution period of task i. In other words, Ei/Ti corresponds to the fraction of CPU time required to execute task i.

Table 5-1 The table below shows the value for size n(21/n – 1) based on the number of tasks. The upper bound for an infinite number of tasks is given by ln(2), or 0.693, which means that you meet all hard real-time deadlines based on RMS, CPU usage of all time-critical tasks should be less than 70 percent!

...

RMS says that the highest rate task has the highest priority. In some cases, the highest rate task might not be the most important task. The application should dictate how to assign priorities. However, RMS is an interesting starting point.

...

Number of Tasks

...

n(21/n-1)

...

1

...

.

...

2

...

0.828

...

3

...

0.779

...

4

...

0.756

...

5

...

0.743

...

:

...

:

...

:

...

:

...

:

...

:

...

Infinite

...

0.693

Table 5-1 Allowable CPU usage based on number of tasks