-
Notifications
You must be signed in to change notification settings - Fork 218
enhance sched_getaffinity function to avoid early crash when counting available cores on systems with more than 1024 cores #3701
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
enhance sched_getaffinity function to avoid early crash when counting available cores on systems with more than 1024 cores #3701
Conversation
Dynamically determine the size of the cpu_set_t struct doubling it on each try
|
@Flamefire Can you mention the error/crash you run into without this fix in the PR description? |
|
Added |
|
Apart from my comment above this code is sane and correct. |
boegel
left a comment
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.
lgtm
akesandgren
left a comment
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.
LGTM
|
Going in, thanks @Flamefire! |
Dynamically determine the size of the cpu_set_t struct doubling it on each try
This is basically what the os module in Python 3.3+ does, see e.g. https://github.com/akheron/cpython/blob/f91d2f2e2e992c3006a5023eb4ba3cf0d082fde8/Modules/posixmodule.c#L5706
Error shown even on
eb --helpis: