This class explores where and why real time is required, various definitions of real time, and the effect of the OS on a real-time design. It also examines design methods and programming-language features appropriate for real time, identifes OS requirements for real time (preemptible kernel, priority inversion avoidance, nested interrupts, time partitioning, etc), and explores the tradeoffs between using a general-purpose or real-time OS. Practical issues, such as setting appropriate task priorities and avoiding high-frequency interrupts, are also covered.
Key take-awaysThe complexity of today’s firmware can create immense problems at integration time, when competing demands for CPU time can result in anything from a slow HMI to system failure. Using an automotive handsfree phone system as an example, this class shows how time partitioning can prevent these integration headaches. Briefly stated, time partitioning lets you place software subsystems into virtual compartments (called partitions) and to allocate a CPU budget to each partition (30% of CPU time for navigation, 20% for MP3 playback, etc). With this approach, each subsystem is guaranteed its share of CPU cycles, regardless of how busy subsystems in other partitions become.
Key take-awaysGetting software to run on a multi-core processor is, in many cases, fairly easy. The challenge is getting the software to make full use of all the processor’s cores. In this class, we examine various techniques for optimizing embedded applications on multi-core chips. We address threading models for creating multiple concurrent tasks and parallel processing for increased performance. We also discuss how to minimize lock contention with mutexes and semaphores by engineering the appropriate levels of lock granularity, how to identify and resolve deadlock issues, and how to reduce unnecessary thread migration.
Key take-aways