Realtime

What's Realtime?

Real Time != Real Fast, it's about determinism. RTOS will deliver decent overall throughput (performance) but can sacrifice throughput for being deterministic (or predictable)

Two Types of Realtime

Hard real-time

A system is considered as a hard real time if it can answer to an internal or external stimulus within a given maximum amount of time. “Guaranteed worst case”.

Hard real time systems are used wherever failing to react in time can cause a system failure or damage, or put its users in danger. Typical examples:

  • air traffic control
  • vehicle subsystems control
  • Medicine (pacemakers, etc.)

Soft real-time

A system is considered as soft real time if it is built to react to stimuli as quickly as it can: “best effort”.

However, if the system loses events or fails to process them in time, there is no catastrophic consequence on its operation. There is just a degradation in quality. Typical examples

  • Voice over IP
  • multimedia streaming
  • computer games

Current Status

Here is something that only a few people know: About 95% of real-time capabilities have already been merged into mainline Linux. The remaining 5%, however, are of particular relevance to industrial users. User support, therefore, is urgently needed at this point.

The PREEMPT_RT project will be done in 2014, "one way or another". The first way would be to get most of the rest of the code upstream, but that will require more of an effort, from a wider group than is currently involved. The alternative is to decide that the 95% of the realtime work already upstream is good enough and to drop further efforts.

Main contributors were:

  • Doug Niehaus, Professor at Kansas University, USA
  • Ingo Molnár for Red Hat
  • Thomas Gleixner, CEO of Linutronix, for several clients
  • Paul McKenney for IBM and
  • Steven Rostedt for Red Hat

After the basic components were developed from 2000 to 2006, they were gradually merged into the mainline Linux kernel, a task that is about 90% completed. The remaining 10% are available as the so-called PREEMPT_RT patch. At present, the patch is being maintained and adapted to the current Linux kernel by Thomas Gleixner and his coworker, Sebastian Siewior, at Linutronix.

Once the mainline Linux kernel has been equipped with real-time capabilities and is appropriately configured, a real-time operating system will be available that is largely capable of coping with established RTOS kernels in many ways. The two key benefits of a real-time mainline Linux kernel are

  • guaranteed real-time features for the vast majority of industrial systems, and
  • an API exclusively based on the POSIX standard.

The fact that the response behavior of such a real-time Linux kernel is predictable and can actually be guaranteed has been confirmed by long-term measurements at the test center of the Open Source Automation Development Lab (OSADL) in which 100 million trigger pulses per test system are evaluated daily under different stress and load scenarios. The results were depicted in sequential latency plots. The logarithmic scaling of the frequency values in the y-direction makes it possible to visualize even a single outlier. As can be seen in an example measurement, not a single outlier arose in over 60 billion cycles. The maximum measured latency of the 2700-MHz Intel processor of around 20 µs is about that which is achieved by dedicated RTOS kernels (see Figure 1).