What is the difference between hard, firm and soft real-time?
Short answer: In a hard real-time system, missing a deadline is a system failure (airbag deployment, engine control, pacemaker, motor commutation). In a firm system, a late result is worthless but occasional misses are tolerated (a dropped video frame, a missed sensor sample). In a soft system, late results still have some value, just less (UI responsiveness, audio buffering with retries, network throughput).
| Hard | Firm | Soft | |
|---|---|---|---|
| Missed deadline | failure / hazard | result discarded | degraded quality |
| Analysis | worst-case execution time (WCET), schedulability proof | statistical + worst case | average performance |
| Examples | ABS brakes, flight control, motor current loop | video decode, telemetry sampling | UI, logging, streaming with buffers |
| Typical platform | MCU/RTOS, Cortex-R, lock-step cores | RTOS or Linux with PREEMPT_RT | Linux, Android |
Real systems mix them: a drone has a hard-real-time attitude control loop (e.g. 1 kHz), firm-real-time sensor fusion, and soft-real-time telemetry and video. Good designs isolate the hard parts: highest priorities, dedicated cores, or a separate MCU.
Key terms
- Deadline: latest time by which a result must be produced.
- Jitter: variation in timing (e.g. start times of a periodic task); control loops often care more about jitter than about the absolute delay.
- WCET: worst-case execution time of a piece of code, measured or computed by static analysis tools (aiT, RapiTime), affected by caches, branch predictors and interrupts.
Interview follow-up: "Is Linux real-time?" Standard Linux is soft real-time; with PREEMPT_RT, worst-case latencies of tens of µs are achievable, which suits many firm and some hard requirements, but safety-critical hard real-time still usually runs on an RTOS or a separate core.