Lecture 13: Real-time scheduling

NOTE: Not relevant for the exam.

Previous lecture Next lecture

Real-time computer systems

A real-time computer system is a computer system in which the correctness of the system behavior depends not only on the logical results of the computations, but also on the physical instant at which these results are produced.

Example: inverted pendulum

Deadlines

How long does a program run?

The estimated WCETEST has to be guaranteed larger or equal to the real WCET. However, the difference between the two should be as small as possible ("tight bounds").

Trigger

… to initiate computation ("task") can be realized in different ways:

Event-triggered real-time systems

Time-triggered real-time systems

Example: OSEKtime

Objectives of the OSEKtime OS [2]:

OSEKtime scheduler

Offline scheduling

Real-time scheduling

Rate-monotonic scheduling (RM)

RM assumptions (Liu & Layland 1973)

Example: car headlight controller

... everything is periodic!

RM algorithm

A practical implementation of RM scheduling requires only an operating system with a preemptive fixed priority scheduler

Schedulability analysis

U: system load, m: number of tasks But is this sufficient?

The "70% rule"

Sufficient and necessary conditions

Exact test: response time analysis

Exact test: iterative solution

for (each task 𝜏i) {
  I = 0
  do {
    R = I + Ci
    if (R > Ti) return false // deadline violation
    I = <formula>
  } while (I + Ci > R)
}
return true // all deadlines are kept

Rate-monotonic scheduling is "optimal"

What is the effect of swapping the priorities (only) of these two tasks? 𝜏j can be scheduled, since it now has higher priority. 𝜏i can also be scheduled since Ci + Cj ≀ Tj < Ti.

We obtain an RM schedule by applying a finite number of these swaps. This is also a valid schedule β†’ contradiction β†’ RM is optimal!

RM scheduling: conclusion

Example: Earliest Deadline First

EDF algorithm

Optimality of EDF

EDF-Scheduling: Conclusion

Outlook: Extending the strategies