Issue 426: Add resume and suspend hook extensions #429
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Existing ThreadX source has a very powerful hook for thread entry and exit. This hook allows tracking of processor utilization for each task (by observing when it enters and leaves the processor), as well as any other usage deemed appropriate by the developer.
No such equivalent hook(s) exist for the suspension and resumption of threads, making it difficult to observe how long from the time a thread becomes ready until it first enters the processor, and eventually is suspended as well.
This pull request adds such hooks. At the same time, it does not follow the format and structure of the entry and exit hooks, as those were written with the expectation that developers and users would not have direct access to the source code, and as such, the hooks are less performant than they could otherwise be. This pull request therefore uses a more direct approach to allow installation of callback extensions that should have no performance impact when not enabled.
Work In Progress
This is not a mergeable commit, as it includes modifications to things that should not be committed upstream. Importantly, it shows two possible approaches to installing/including the hooks. Furthermore, I have not yet benchmarked any performance impact of a system with the hooks enabled vs a system without the hooks.
PR checklist