-
Notifications
You must be signed in to change notification settings - Fork 2.1k
sys/event: manage event thread size via build system #21941
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
base: master
Are you sure you want to change the base?
sys/event: manage event thread size via build system #21941
Conversation
This can be used to get the highest value out of a list of numeric numbers in a Makefile variable separated by whitespace.
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.
This adds a simple integration test for declaring the stack size requirements in modules.
Co-authored-by: benpicco <[email protected]>
Co-authored-by: benpicco <[email protected]>
|
I defused the footgun with potential confusion of event thread names and event queue names. E.g. if I think a module posting to |
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