Painless Multithreading: How to Verify RTOS Best Practices in Runtime
Developing reliable and performant RTOS applications is easier said than done, and is greatly facilitated by a solid software design that follows best practices in RTOS application development. While an RTOS makes it easier to develop more advanced applications, the use of multithreading brings new challenges in software design, verification and debugging. Such issues are often not apparent in the application code.
In this presentation, we will discuss a selection of best practices in RTOS-based software design and the concept of visual trace diagnostics. Finally, we will explore how visual trace diagnostics can be used to analyze the software design and detect deviations from best practices.
What this presentation is about and why it matters
How do you verify RTOS best practices when the real problems only appear at runtime? Johan Kraft frames that tension through visual trace diagnostics, using a few compact RTOS examples to show how scheduling, delays, semaphores, and mutexes reveal themselves in trace data. The talk is hands-on and practical, grounded in FreeRTOS-style task behavior and the Tracealyzer workflow. Rather than treating multithreading as a static code review problem, it focuses on what you can observe, measure, and spot in a trace. It is especially useful for embedded teams trying to make task interactions easier to reason about and easier to debug.
Who will benefit the most from this presentation
- Embedded software developers working with an RTOS and wanting to check task behavior at runtime
- Firmware engineers who already use delays, semaphores, or mutexes and want clearer diagnostics
- Technical leads reviewing multithreaded design choices across a team with mixed RTOS experience
- Engineers responsible for debugging timing-sensitive or priority-sensitive task interactions
What you need to know
A basic familiarity with RTOS concepts will help:
- Tasks or threads, plus the idea of scheduling priorities
- Common RTOS primitives such as delays, semaphores, and mutexes
- Comfort reading simple runtime traces or task timing plots
Glossary (terms used in this talk)
- RTOS (Real-Time Operating System): An operating system designed to provide predictable timing behavior for real-time applications.
- Visual trace diagnostics: An approach to runtime analysis that turns trace data into higher-level views of execution, scheduling, and interactions. The goal is to make system behavior easier to inspect than raw event streams alone.
- Software event tracing: A runtime monitoring technique that records software-generated events such as task switches or application markers. It sits between low-level instruction tracing and higher-level logging in abstraction and overhead.
- vTaskDelay: A delay call that suspends a task for a relative interval from the time the function is called. It is useful for simple waits, but the resulting period also includes execution time and preemption effects.
- vTaskDelayUntil: A delay call that schedules the next wake-up relative to the task's last activation time. It is commonly used when a task needs a stable periodic rate.
- HAL_Delay: A vendor-supplied delay function often used in embedded firmware. It blocks by waiting in a loop rather than suspending the task through the RTOS.
- xSemaphoreTake: An RTOS API call used to wait for or acquire a semaphore or mutex resource. It is commonly used to block until a signal is given or a shared resource becomes available.
- xSemaphoreGive: An RTOS API call used to release a semaphore or mutex resource, or to signal another task. It is commonly paired with a corresponding take call.
Toolbox (mentioned in this talk)
- FreeRTOS: A widely used real-time operating system for embedded systems. It is commonly integrated as a library that the application initializes and then starts scheduling tasks.
- Tracealyzer: A trace visualization and analysis tool for embedded systems, used to inspect task execution, timing, and RTOS interactions from recorded runtime data.
- Percepio RTOS Debug Portal: A documentation and article portal covering RTOS debugging topics and visual trace diagnostics use cases.
Final thoughts
Practical and example-driven, this session gives you a diagnostic lens for multithreaded embedded software instead of a checklist to memorize. The value is in seeing how trace data exposes behavior that code alone can hide, especially when timing and task interaction start to matter. It will help RTOS users, firmware developers, and reviewers who need to spot design problems earlier. The talk stays close to the mechanics of real systems, and that makes the lessons easy to carry back to day-to-day work.This overview is AI-generated from the session transcript. Spot an issue? Let us know.








Great presentation! Perfectly illustrates how even "simple" systems of 2 or 3 tasks can have complex timing interactions that may not be easily predicted. The visualizations provided by the tool make it easy to see.