Skip to content
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

Simplified priority inheritance explanation #88

Merged
merged 5 commits into from May 8, 2024

Conversation

kstribrnAmzn
Copy link
Member

Description of changes:

Add explanation of mutex priority inheritance
behavior along with important differences a
user should be aware of.

Issue #, if available:

FreeRTOS/FreeRTOS#1168

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Add explanation of mutex priority inheritance
behavior along with important differences a
user should be aware of.
paulbartell
paulbartell previously approved these changes Apr 25, 2024
kar-rahul-aws
kar-rahul-aws previously approved these changes May 2, 2024
ch08.md Outdated
@@ -713,7 +716,7 @@ FreeRTOS mutexes and binary semaphores are very similar—the difference
being that mutexes include a basic 'priority inheritance' mechanism,
whereas binary semaphores do not. Priority inheritance is a scheme that
minimizes the negative effects of priority inversion. It does not 'fix'
priority inversion, but merely lessens its impact by ensuring that the
priority inversion, but merely lessens its impact by ensuring that the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra character get introduced?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix this

ch08.md Outdated
@@ -737,6 +740,23 @@ As just seen, priority inheritance functionality effects the priority of
tasks that are using the mutex. For that reason, mutexes must not be
used from interrupt service routines.

The priority inheritance scheme implemented by FreeRTOS is described as
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion:
"FreeRTOS implements a basic priority inheritance mechanism which was designed with optimizing both space and execution cycles in mind."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update this in the next commit

ch08.md Outdated
at a time.

Specific behaviors of the priority inheritance mechanism to keep in mind:
* A task can have an already inherited priority raised further if it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion:
"A task can have an already"
to
"A task can have its already"

ch08.md Outdated
at a time.

Specific behaviors of the priority inheritance mechanism to keep in mind:
* A task can have an already inherited priority raised further if it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest breaking this up into multiple bullet points to make it clear that priority is only disinherited after all mutexes are released. It does not depend on if the second mutex was acquired before or after priority is increased through inheritance.

@kstribrnAmzn kstribrnAmzn merged commit 800f6a0 into FreeRTOS:main May 8, 2024
@kstribrnAmzn kstribrnAmzn deleted the priorityInheritance branch May 8, 2024 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants