3 ms·
>more-or-less hard real time Also known as soft realtime. For hard realtime, you need guarantees. Linux is too complex and cannot possibly offer them; this is
by snvzz 5y ago
>more-or-less hard real time
Also known as soft realtime.
For hard realtime, you need guarantees. Linux is too complex and cannot possibly offer them; this is the territory of formal proof, with complexity growing exponentially with code size.
Look at seL4 for hard realtime.
- PaulDavisThe1st 5y agoEven with the "guarantees" offered by e.g. seL4, you still need cooperating hardware. SMIs on most mobos cannot be masked, and can take an eternity to be handled by the BIOS. Fortunately, for realtime audio, you don't need hard realtime unless you're very close to overloading the CPUs. Soft realtime (i.e. 99% of all interrupts handled within N usecs, 100% handled with N*2) is good enough.
- jeffreygoesto 5y agoRight. Also for hard realtime with 100% deadline guarantees (absence of soft and programming errors assumed, for a second) you would choose an appropriate CPU like the ARM Cortex-R series. You'd also take care of the peripherals, i.e. choose 801.2AS or even Flexray.
- zurn 5y ago100% handled with N*2 would be hard realtime.
- kbumsik 5y agoNo. Soft real time can miss some real time deadline. AFAIK Linux RT kernel is designed to hit every deadline, but they just cannot offer a formal proof. So "more-or-less" hard real time.
- ComputerGuru 5y agoOne of the problems is that the Linux RT kernel doesn’t stop you from using/writing devices/drivers that break those guarantees systemwide, as I understand it.
- colonwqbang 5y agoWhat kernel can give such a guarantee?
- dspillett 5y agoOne that has no such drivers? Which would then imply limited hardware support as the price for the guarantee, which is a trade-off a general purpose kernel like Linux isn't going to make.
- _flux 5y agoA microkernel one, potentially at least.
- lloeki 5y agoA kernel alone on a random hardware platform can't, but a kernel and a hardware core that watchdogs and flips the bird at a rt-violating driver+device, sure (I've toyed with VxWorks on devices that work this way). Usually when you're entering that realm of such requirements, you're rarely talking about off-the-shelf devices.
- snvzz 5y agoseL4[0]. I'm not aware of any other. [0]: https://sel4.systems/ https://sel4.systems/
- snvzz 5y ago>AFAIK Linux RT kernel is designed to hit every deadline, but they just cannot offer a formal proof. And that's why it is soft realtime. No guarantee, no hard realtime. It really is that simple.
- jcelerier 5y agoLinux has the ability of entirely freeing a few CPU cores with isolcpus though, so that you can implement your own real-time loop on it
- snvzz 5y agoSure. And you can also run an RTOS on a separate chip, elsewhere on the same PCB. Linux is still Linux, and it is still fundamentally not capable of hard realtime.