Identifying the sources of non-determinism

Fundamentally, real-time programming is about making sure that the threads controlling the output in real-time are scheduled when needed and so can complete the job before the deadline. Anything that prevents this is a problem. Here are some problem areas:

  • Scheduling: Real-time threads must be scheduled before others so they must have a real-time policy, SCHED_FIFO, or SCHED_RR. Additionally they should have priorities assigned in descending order starting with the one with the shortest deadline, according to the theory of Rate Monotonic Analysis that I described in Chapter 10, Learning About Processes and Threads.
  • Scheduling latency: The kernel must be able to reschedule as soon as an event such as an ...

Get Embedded Linux for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.