|A real-time computing system is able to very reliably execute programs with very specific timing requirements, something that is important for many science and engineering projects. The key component that is needed to build a real-time system is a Real-Time Operating System (RTOS); other hardware and software pieces that make up an entire real-time system are discussed in the next section.
For many engineers and scientists, running a measurement or control program on a standard PC with a general-purpose OS installed (such as Windows) is unacceptable. At any time, the operating system might delay execution of a user program for many reasons: to run a virus scan, update graphics, perform system background tasks, and more. For programs that need to run at a certain rate without interruption (for example a cruise control system), this delay can cause system failure.
Note that this behavior is by design: general-purpose operating systems are optimized to run many processes and applications at once and provide other features like rich user interface graphics. In contrast, real-time operating systems are designed to run a single program with very precise timing. Specifically, real-time operating systems can allow you to:
- Perform tasks within a guaranteed worst-case timeframe
- Carefully prioritize different sections of your program
- Run loops with nearly the same timing each iteration (typically within microseconds)
- Detect if a loop missed its timing goal
When researching real-time computing systems, you may run across the terms "hard real-time" and "soft real-time". To clarify, hard real-time systems are designed to absolutely guarantee that a task will execute within a certain worst-case timeframe. Therefore, for projects involving safety or systems that could result in a large investment in the event of failure, hard real-time is often a requirement. On the other hand, soft real-time systems are designed to satisfy your timing requirements most of the time but without absolute certainty. This can be acceptable for operations like video processing, where a lost data frame is not good but may not necessarily be a critical problem.
Figure 1. Hard real-time systems guarantee (when programmed correctly) that a deadline will be consistently met, while soft real-time systems may periodically exceed the deadline.
If you are interested in a more detailed explanation on how real-time operating systems work or wish to explore common real time terms like "determinism" and "jitter", you can read the paper: What is a Real-Time Operating System?.
In addition to providing precise timing, real-time computing systems can be set up to run reliably for days, months, or years without stopping. This is important not only for engineers building systems that need 24-7 operation, but also for any application where down time is costly. A "watchdog" feature is also typically included in real-time systems to automatically restart an entire computer in the event that the user program stops running. Furthermore, hardware used in a real-time system is often made very rugged to sustain harsh conditions for long periods.