Skip to content

bpo-41440: add os.cpu_count() support for VxWorks RTOS #21685

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

Merged
merged 10 commits into from
Aug 7, 2020

Conversation

pxinwr
Copy link
Contributor

@pxinwr pxinwr commented Jul 30, 2020

VxWorks RTOS provides API vxCpuEnabledGet() to get the set of running CPUs in the system. The return value of vxCpuEnabledGet() is the type cpuset_t defined as shown below. Every bit in the cpuset_t represents the individual CPU No. That is bit 0 corresponds to cpu0, bit 1 corresponds to cpu1, etc. So counting the ones count with __builtin_popcount will get the running CPU count.

typedef unsigned int cpuset_t;

https://bugs.python.org/issue41440

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@corona10 corona10 requested a review from vstinner July 30, 2020 14:33
@pxinwr
Copy link
Contributor Author

pxinwr commented Jul 31, 2020

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@corona10: please review the changes made to this pull request.

@bedevere-bot bedevere-bot requested a review from corona10 July 31, 2020 06:02
Copy link
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit change

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@pxinwr
Copy link
Contributor Author

pxinwr commented Jul 31, 2020

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@corona10: please review the changes made to this pull request.

@bedevere-bot bedevere-bot requested a review from corona10 July 31, 2020 08:24
@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

And if you don't make the requested changes, you will be put in the comfy chair!

@pxinwr
Copy link
Contributor Author

pxinwr commented Aug 1, 2020

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@corona10: please review the changes made to this pull request.

@bedevere-bot bedevere-bot requested a review from corona10 August 1, 2020 13:48
pxinwr and others added 2 commits August 4, 2020 10:36
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
@corona10 corona10 requested a review from vstinner August 5, 2020 08:44
@corona10 corona10 merged commit 3405e05 into python:master Aug 7, 2020
@pxinwr
Copy link
Contributor Author

pxinwr commented Aug 10, 2020

@corona10 Thanks for merging it.

shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Aug 20, 2020
xzy3 pushed a commit to xzy3/cpython that referenced this pull request Oct 18, 2020
@pxinwr pxinwr deleted the fix-issue-31904-cpucount branch July 12, 2021 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants