-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
lib: posix: dynamic stack support for pthread_create #44727
lib: posix: dynamic stack support for pthread_create #44727
Conversation
e952741
to
d288c14
Compare
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
d288c14
to
78d154c
Compare
52503b3
to
e7daa08
Compare
|
cfa7228
to
60b5cbf
Compare
|
60b5cbf
to
b0fefbf
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ready to me.
minor comments, it is looking pretty good ! |
b0fefbf
to
4340ab4
Compare
Previously, the kernel stack size was adjusted for no apparent reason. Signed-off-by: Christopher Friedt <cfriedt@meta.com>
With some of the recent work to disable unnecessary system calls, there is a scenario where `z_impl_k_thread_stack_free()` is not defined and an undefined symbol error occurs. Safety was very concerned that dynamic thread stack code might touch other code that does not malloc, so add a separate file for the stack alloc and free stubs. Signed-off-by: Christopher Friedt <cfriedt@meta.com>
This change allows users to call pthread_create() with the pthread_attr_t argument equal to NULL. If Zephyr is configured with `CONFIG_DYNAMIC_THREAD`, then a suitable thread stack will be allocated via k_thread_stack_alloc(). The allocated thread stack is automatically freed via k_thread_stack_free(). This makes the Zephyr implementation of pthread_create() compliant with the normative spec. Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Tests for dynamically allocated POSIX thread stacks. Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
4340ab4
to
4a69113
Compare
|
Unrelated errors are unrelated. Need to wait until a hotfix or 2 rolls in |
@keith-packard @ceolin - look ok? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ready; had a question about whether you want to require any attribute use to include a stack as that doesn't seem entirely compatible with POSIX? Happy to let that come in a later PR.
There are other use cases - another PR would be good and a kconfig of course. |
Support automatic thread stack allocation for
pthread_create()
, which is required as part of IEEE Std. 1003.2017 (and all earlier versions).For more info, see
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_create.html
Fixes #25973
(Note: This depends on #44379 and #59773)