-
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
core: provide main thread as optional default module #10971
Conversation
When providing a pseudo-submodule for a module already using the `SUBMODULES` mechanism to provide submodules, it is not possible to create a true pseudo-module as submodule (i.e. one without any code on its own), since the build system currently always expects there to be a C file `module_submodule.c`. This removes this requirement.
The way this is done, disabling the main thread also disables auto init. There are two options:
The problem with (1) is that if there is no main thread and no auto_init, who initializes stuff (maybe I'm missing something?) |
I was aware of that, but forgot to mention this in OP. For now I would prefer to keep (1) with a later move to (2) in a follow-up (which would be distinct from the application-specific setup routine I'm planning to propose, once the pseudo-module issue in #10970 is resolved) |
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. |
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. |
Contribution description
For a private project of mine I did not really need the main thread. At most I needed it for some device-setup (I will also provide a feature to do that without
main()
that), but the rest was basically happening in ISR (or for other applications the action might happen in other threads). While it isn't really necessary for my specific case, as the board has a large enough memory, to cope with that, but basically I am wasting a lot of memory, just for simple initialization. As such I am wondering if we could provide a mechanism to completely remove the main-thread and is stack. This is my proposal for that.Testing procedure
All applications should still compile and work as before. When compiling with
DISABLE_MODULE=core_main
most applications should still compile, they might not work properly anymore, but they should be significantly smaller.Issues/PRs references
Requires #10970