-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Causing deadlocks while using priority inheritance that are avoidable with priority ceiling #8330
Causing deadlocks while using priority inheritance that are avoidable with priority ceiling #8330
Conversation
…tersen/RIOT into causing_deadlocks_with_prioinheritance
Hi @mmkonrad . Sorry for the delay on addressing your PR. Thanks for your contribution :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
The sole purpose of this PR is to raise awareness of the possible necessity to implement a priority ceiling module.
It started with #7365 where it was discovered by @geith that RIOT OS is not yet protected against the priority inversion problem.
As a result @haukepetersen implemented tests for this problem (-> see #7444 and #7372) and implemented a module for priority inheritance fixing this problem as stated in PR #7445 .
As a part of a university project I had to cause deadlocks while using this module. Since it is easy to cause deadlocks by having two threads trying to lock e.g. a mutex the respective other holds, the idea was provided to construct a case where a deadlock could be prevented whith priority ceiling.
The code used in this scenario is based on the example provided by @geith in #7365. As can be seen in the graphic, having a module for priority inheritance wouldn't cause this program to get stuck.
Of course this constructed scenario could easily get avoided by a capable programer but having the option to use priority ceiling would increase the latitude of the users when facing edge cases.