← Back to context

Comment by GekkePrutser

3 years ago

It is a shame yes. There is no current desktop RTOS at all afaik.

I know an RTOS does not guarantee smooth desktop performance but I just would love to try it out to compare.

FWIW, Windows is not a true RTOS, but it does get pretty darn close.

The true hallmarks of an RTOS kernel is hard-realtime scheduling usually with round-robin priorities, and support for priority inversion, which is when a low priority process blocks a high priority one, it inherits the high priority temporarily to meet the deadline.

Windows is threads have a priority, with the highest priority thread occupying the CPU - however there's a series of 'hacks' that allow it to emulate real time behavior.

Threads can get a priority boost in some cases, such as the aforementioned priority inversion case, when the user interacts with the program associated with the thread, when the thread hasn't run for a long time etc.

Additionally there's a set of 'real-time' priorities that can preempt all non-realtime priorities and you need admin or kernel access to set this prio level, as these threads will lock up your system because they can't be preempted.

While I wouldn't trust Windows to control an ICBM, but it's good enough at giving resources to user processes so the your UI feels responsive.

> There is no current desktop RTOS at all afaik.

Plan 9 has deadline scheduling out-of-the-box for real-time. It runs on x86-64, 386, Arm v7 and AArch64 (And more): http://doc.cat-v.org/plan_9/real_time/ (mostly obsolete but describes the motivation and implementation)

See proc(3) man page for deadline scheduling (towards the bottom real-time i described): http://man.9front.org/3/proc (I always recommend the actively maintained 9front fork)

The best part is you don't need special patches or libraries. You simply configure the process/group by writing messages to the procs ctl file using the command line, a script, or from within your program.

  • Lots of unixes have real time scheduling classes (Linux too), comes with the POSIX RT APIs. Is there information somewhere about the real-timeness performance of Plan 9 that could be compared with current general purpose operating systems?

  • Interesting. Is that a desktop OS though? I'll have a play with it soon. Thanks for the heads-up.

    • It is a distributed OS that can run as a standalone workstation or desktop/laptop. Although it looks like Unix, it is not (same creators though).

Linux with a kernel built with RT_PREEMPT ?

  • "Folks, we're just waiting on word back from the tower while our instrument panel blocks to render a thumbnail of the airport. We should be touching down in 30 to INT_MAX minutes or so. In the meantime if you want to sit back and watch a movie on your entertainment panel we ask that you refrain from apt installing the non-free Nvidia drivers which can sometimes cause our landing gear to stick..."

    "Folks, we're going to go ahead and uninstall Gnome and see if we can't get on the ground a little earlier. Should be anywhere from 30 to INT_MAX minutes. In the meantime a flight attendant will be coming around with wired keyboards if you'd like to play a free game of Snake on your Entertainment terminals..."