sys/event: manage event thread size via build system#21941
Merged
benpicco merged 3 commits intoRIOT-OS:masterfrom Dec 9, 2025
Merged
Conversation
This can be used to get the highest value out of a list of numeric numbers in a Makefile variable separated by whitespace.
benpicco
reviewed
Dec 8, 2025
benpicco
reviewed
Dec 8, 2025
Member
Author
|
I defused the footgun with potential confusion of event thread names and event queue names. E.g. if I think a module posting to |
benpicco
approved these changes
Dec 9, 2025
Contributor
benpicco
left a comment
There was a problem hiding this comment.
That is a really nice addition!
This adds a mechanism for modules to declare requirements on the thread stack size in their `Makefile.dep` and let the build system then override the default stack size, if any requirements are declared. The motivation is to allow multiple modules to have special requirements without causing conflicts, as just adding the following to their `Makefile.include` would do: ```Makefile CFLAGS += -DEVENT_THREAD_MEDIUM_STACKSIZE=<MAGIC_NUMBER> ``` Instead, the new mechanism would work by having them both declare in their `Makefile.dep`: ```Makefile EVENT_THREAD_MEDIUM_STACKSIZE_MIN += ``` The build system then picks the maximum number in `EVENT_THREAD_MEDIUM_STACKSIZE_MIN` and exposes this as stack size, if any module did declare a minimum requirement. Co-authored-by: benpicco <[email protected]>
This adds a simple integration test for declaring the stack size requirements in modules.
2db5023 to
37eb213
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Contribution description
This adds a mechanism for modules to declare requirements on the thread stack size in their
Makefile.depand let the build system then override the default stack size, if any requirements are declared.The motivation is to allow multiple modules to have special requirements without causing conflicts, as just adding the following to their
Makefile.includewould do:CFLAGS += -DEVENT_THREAD_MEDIUM_STACKSIZE=<MAGIC_NUMBER>Instead, the new mechanism would work by having them both declare in their
Makefile.dep:EVENT_THREAD_MEDIUM_STACKSIZE_MIN +=The build system then picks the maximum number in
EVENT_THREAD_MEDIUM_STACKSIZE_MINand exposes this as stack size, if any module did declare a minimum requirement.Testing procedure
The test in
tests/sys/event_thread_sharedhas been extended to test correct passing of the stack size value at compile time. So a green CI would be sufficient.Issues/PRs references
None