Home >

Painless Multithreading: How to Verify RTOS Best Practices in Runtime

Dr. Johan Kraft - Watch Now - Duration: 34:24

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.

M↓ MARKDOWN HELP
italicssurround text with
*asterisks*
boldsurround text with
**two asterisks**
hyperlink
[hyperlink](https://example.com)
or just a bare URL
code
surround text with
`backticks`
strikethroughsurround text with
~~two tilde characters~~
quote
prefix with
>

Hammarbytp
Score: 0 | 6 months ago | 1 reply

Hi, thanks for the talk.
I think the differences between Mutexes and semaphores in terms of priority inheritance is not the same across OS's. Vxworks (I beleive) provide priority inheritance for both semaphores and mutexes. However you are right to point out the complexity of semaphores and a relatively simple concept can get the unwary into a lot of trouble. We have had situations where you have 3 tasks sharing 2 semaphores, we can get a situation sharing two semaphores from both higher priority task, but when it release the higher priority task semaphore it maintains its higher priority despite only blocking a medium priority task, so causing a un-necessary delay in the higher task. These are largely caused by little known subtleties and different implementations of semaphores. This is not helped by the fact atht a) developers tend to throw semaphores and mutexes in as a safety feature, even if they are not actually needed and b) often the semaphore is used within the OS function calls itself, so you are not aware that a semaphore is being called

In fact the trend has to been look at alternatives to semaphores for this very reason

JohanKraft
Score: 0 | 6 months ago | no reply

Yes, my presentation was a bit simplified in this regard. There are other options for implementing signals between tasks that have more clear meaning, like task notifications in FreeRTOS, or message queues.

JohanKraft
Score: 0 | 7 months ago | no reply

Hi Gary. Thanks! Zephyr support is in progress. We are working on a new Tracealyzer release, v4.5.0, where Zephyr will be supported. This should be out in a few weeks. Target-side support will most likely be included in the next Zephyr release (v2.6) and I'm presenting the solution at the Zephyr Developer Summit on June 9. See https://github.com/zephyrproject-rtos/zephyr/wiki/2021-Zephyr-Developer-Summit.

garyhubley
Score: 0 | 7 months ago | no reply

Thanks for a great talk Johan!

Out of curiosity, does tracealyzer support Zephyr RTOS as well. All the demos I have seen at the conference so far have used freeRTOS.

JohanKraft
Score: 0 | 7 months ago | no reply

Welcome to this presentation. I'm available here between 15-16 CET, and then in the live Q&A session. But you can also post questions here afterwards and I'll try to answer as soon as possible.

OUR SPONSORS