Is Linux really real-time? RTOS, QNX and the PREEMPT_RT kernel

Eric, that’s an excellent distinction. Genuine Real-time systems of any type are NOT common at all, and Real-time Linux systems are even less common. Offhand I do not know the name of any Real-time Linux distribution.

I have actually used a couple of real-time systems, and I even worked on a project where I ran a test suite every day for the real-time system’s libraries, particularly their I/O and mathematics libraries. I don’t remember the details on how these real-time systems were used by customers, but I suspect that they were used in some type of machine-based mechanisms and read measurements, provided statistics, and therefore used I/O and math libraries. That was an interesting assignment!

3 Likes

Searching I found:

3 Likes

The only system, Linux-like, that I know to be “Real-Time” is

  • QNX (Wikipedia “introduction”)

  • QNX (Corporate Home)

Hayden, I will have to review those to see if they truly are RTOS-rated.

4 Likes

Sounds good. I haven’t reviewed. Only shared in real-time. No pun intended.

1 Like

It seems that the Linux kernel is listed here (a list of RTOSs).

3 Likes

Since you have real-time Ubuntu in that list
You might as well add Ubuntu-Studio. :slight_smile:

2 Likes

Hmm… According to Ubuntu Studio - Wikipedia Ubuntu Studio uses low-latency and not real-time kernel version.

3 Likes

Yes indeed :slight_smile:
You can see I haven’t touched the laptop in a while :innocent:

Linux 6.8.0-90-lowlatency
#91.1-Ubuntu SMP PREEMPT_DYNAMIC
Thu Nov 27 12:26:22 UTC 2025
x86_64 x86_64 x86_64
GNU/Linux

EDIT:

3 Likes

Now that you mention it, what I really want to know is the exact difference.

In music production, between apps,plugins,etc. deadlines have to be met within a short timeframe. I suppose that counts as realtime, does it ?

Realtime means “guaranteed before deadline expires” right ?
Or is it more like “predictable latency” ?

2 Likes

AFAIK, both statements are correct. Another definition of realtime is “will begin processing of an external event within ‘delta’ ms guaranteed”. Realtime does not presumes surge of bulk data processing performance though. IMO video and audio processing does not require realtime as such and enjoy a compromise between performance and (not bounded) ASAP-style events processing.

Probably you may find What is real-time Linux? Part I | Ubuntu interesting to read.

3 Likes

I was using Red Hawk Linux. It allowed to designate specific cores for deterministic real-time use. They were prevented from running any system daemons or services so that any code running on them was not interrupted. Please read the link I’ve put into the post.

A deterministic real time (RTOS) guarantees certified minimum response times. So that any variation outside of the certified response times is a problem on your side. And that’s the closest you will get until you move to a hardware in the loop (HIL) system. It meant that I could run Julia code (which loves multicore processing and makes it really easy to designate which core runs what) and Red Hawk allows one to configure the hardware such that those same cores can be put into 100% uninterrupted use.

Remember, this thread is about choosing a Linux based on what you want to do and I only made the one exception of choosing a deterministic real-time Linux OS as I needed this based on what I wanted to do. It was exactly the right choice!

4 Likes

@ugnvs Yes, totally! Nowhere near real-time. But it has great “virtual wiring” to allow you to join various noise sources and processors together, so it is quite good for music (and I suppose, film) production. Nevertheless, it’s still Ubuntu, and I wiped it by installing Omarchy instead. :grin:

1 Like

@ericmarceau QNX was one of the Real-Time systems I used on my own. VxWorks and some commercial versions of Mercury Computer systems were the ones I participated in testing. Real-time systems was one of numerous things I studied during my undergraduate education.

From the https://realtime-linux.org/ site I quote a passage about what Real-time actually means:
" How Real-Time Linux Works

Real-Time Linux is enabled via a configuration setting in the upstream Linux kernel. This configuration enables a fully preemptible scheduler, meaning a high-priority task can interrupt a lower-priority one, and by minimizing areas where interrupts are disabled. This ensures that critical tasks execute more consistently and predictably.

The primary goal of RT Linux is to minimize latency and jitter, providing more predictable task execution times crucial for time-sensitive applications. Jitter is the variation in task execution times.

The goals of the Real-Time Linux Project are to support users of RT Linux through documentation and system optimization guides, deliver robust performance through test automation, ensure RT Linux is well supported in upstream, and facilitate development roadmaps, in coordination with the broader community."

One other comment, and this is not Real-time, but does have to do with performance: I often use the Liquorix kernel, which, like the information above, has kernel settings that favor particular interactive things, such as mouse clicks and keystrokes at a slight degradation in very large file transfers and depending on the workload, can also increase the CPU temperature, and that’s the Liquorix kernel. The Xanmod kernel does similar things; both of them are appropriate for gaming software. I don’t use gaming software, but I do a lot of interactive typing and navigation, so it’s a good kernel for me. Otherwise it’s similar to a general purpose kernel.

Conversely, I’ve noticed that Red Hat kernels, while okay for interactive use, are most definitely optimized differently than Liquorix kernels; they are best for those big server loads and large data transfers. I’ve often felt over the years that they are slightly sluggish in general interactive use, so they have never been a favorite of mine for personal systems. In corporate environments where I’ve used them on powerful systems, then the interactive sluggishness is not noticed nearly as much due to the sheer power and performance of enterprise servers.

4 Likes

@Brian_Masinick I totally agree with that. At the risk of hijacking my own thread, I should add that for a controller design for a dynamical system, say an aircraft, obviously one wouldn’t fly around with a Linux box with Red Hawk loaded, it’s just for design and testing. The other point is that “real-time” depends critically on the speed of those dynamics. Shannon’s or Nyquist’s sampling theories are the starting point in this area.

Maybe we should forget real-time in this thread, and get back to why some distros might be better suited to some things and other distros for other things. If indeed that’s true. :wink:

3 Likes

I don’t want to “forget” about Real-time systems because they are really important, but I do want to highlight that though it’s possible to use them in a single user capacity, that’s not optimal.

What we can learn from this is that the architecture of Linux in general and the kernel and the choice of init programs are useful for tuning the system to a wide range of workloads.

What might be really cool is if anyone wants to attempt to build a system with multiple kernel configurations and see if it is actually possible to start it as an interactive system one day and a real time system another day. I don’t know if anyone is doing that today but if they are, is either the interactive or the real-time configuration compromised in any way or have they been successful in differentiating between the two?

I don’t know the answer but that’s academically interesting to me. Is that interesting to anyone else?

2 Likes

Roger is correct! We shouldn’t hijack the discussion with an RTOS focus.

Maybe Hayden knows how to split off a group of postings under a new Discussion Topic for “RTOS implementations/considerations”. (I’ve seen that done on other Discourse sites). :slight_smile:



For me, the true test of RTOS is that it can be used to

  • “smooth” control a robotic arm performing a surgical internal operation via teleoperation by remote surgeon (currently being done),       or

  • “smooth” control of machine-tool motion on a 5-axis CNC machine tool in a manner that there is no unforeseen “dwell time” during a move which causes a chink in the surface of a part which is being machined, i.e. 3D airfoil profile.

3 Likes

True; I do believe both discussions are helpful but it may be best to split them apart.

I’m not an expert in the mechanics of the forum software so I’ll leave that up to the boss! :slight_smile:

3 Likes