3 ms·
> The difficulty in doing so is that Android is very much not a realtime system, so trying to run the radio software as, say, a Linux kernel driver would be imp
by kllrnohj 8y ago
> The difficulty in doing so is that Android is very much not a realtime system, so trying to run the radio software as, say, a Linux kernel driver would be impossible.
Not entirely true. Although Linux is not typically real-time you can achieve this by using SCHED_FIFO or SCHED_DEADLINE for a given process/thread.
Android in fact does this for things like audio or display composition.
- ertjaet 8y agoSetting a Linux process to a "realtime" priority (using SCHED_FIFO, etc.) will put above all non-RT /userspace/ processes. But doing that still means that the kernel can preempt you, if it decides to.
- mdwrigh2 8y agoWhile the kernel theoretically has the ability to preempt you, it's not supposed to when using a realtime priority thread. Per the RH realtime guide[[1]: """ SCHED_FIFO and SCHED_RR threads will run until one of the following events occurs: - The thread goes to sleep or begins waiting for an event - A higher-priority realtime thread becomes ready to run If one of these events does not occur, the threads will run indefinitely on that processor, and lower-priority threads will not be given a chance to run. This can result in system service threads failing to run, and operations such as memory swapping and filesystem data flushing not occurring as expected. """ SCHED_DEADLINE, which is newer and not mentioned in the guide, can provide a bit stronger guarantees because it can fail if it thinks the requirements you set aren't actually obtainable based on other system load (including high priority kernel tasks that might need to run, etc). [1]: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_MRG/1.3/html-single/Realtime_Reference_Guide/index.html#chap-Realtime_Reference_Guide-Priorities_and_policies https://access.redhat.com/documentation/en-US/Red_Hat_Enterp...