← Lessons

quiz vs the machine

Platinum1830

Concurrency

The Real Time Scheduling

Scheduling to meet deadlines so work finishes in time, not just eventually.

6 min read · advanced · beat Platinum to climb

Correct means on time

In a real time system a result that arrives late is wrong, even if the value is right. Think of an airbag controller or audio engine. Real time scheduling aims to guarantee that tasks meet their deadlines.

Common policies

  • Rate monotonic gives shorter period tasks higher fixed priority. It is simple and predictable for periodic workloads.
  • Earliest deadline first always runs the task whose deadline is nearest. It can pack the CPU more fully but needs dynamic priority.

Hard versus soft

A hard real time system treats a missed deadline as a failure that must never happen. A soft real time system tolerates occasional misses with degraded quality, such as a dropped video frame.

Why predictability beats speed

Real time scheduling cares about the worst case, not the average. Designers compute whether the task set is schedulable by checking that total demand fits within the available time even at peak. Features that speed up the average case but blow up the worst case, like unbounded caching effects, are often avoided.

Key idea

Real time scheduling guarantees deadlines using policies like rate monotonic or earliest deadline first, optimizing worst case timing and schedulability rather than average throughput.

Check yourself

Answer to earn rating on the learn ladder.

1. What makes a result wrong in a hard real time system?

2. How does earliest deadline first choose what to run?

3. Why does real time design focus on the worst case?