gh-109649: Add affinity parameter to os.cpu_count() by vstinner · Pull Request #109652 · python/cpython
vstinner
changed the title
gh-109649: Add usable parameter to os.cpu_count()
gh-109649: Add affinity parameter to os.cpu_count()
Implement cpu_count(affinity=True) with sched_getaffinity(). Changes: * Fix test_posix.test_sched_getaffinity(): restore the old CPU mask when the test completes! * Doc: Specify that os.cpu_count() counts *logicial* CPUs. Mention that Linux cgroups are ignored.
vstinner
marked this pull request as ready for review
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters