You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"On Windows, GetSystemInfo() is called instead of reading an environment variable. I suppose that this function is more reliable."
From my reading, and based on feedback from one of my customers, I believe he is correct and that GetSystemInfo() ought to be used on Windows. (It is available in pywin32 win32api.)
os.cpu_count() is already implemented with GetSystemInfo() in Python 3.5, so this issue can be closed. Thanks for the reminder Mark, it was useful to double check.
Activity
mark-summerfield commentedon Dec 12, 2014
In message
http://bugs.python.org/issue17914#msg188626
Victor Stenner says
"On Windows, GetSystemInfo() is called instead of reading an environment variable. I suppose that this function is more reliable."
From my reading, and based on feedback from one of my customers, I believe he is correct and that GetSystemInfo() ought to be used on Windows. (It is available in pywin32 win32api.)
vstinner commentedon Dec 12, 2014
The code getting the number of processors on Windows is different between the multiprocessing (Python 3.3) and os (Python 3.5) modules.
multiprocessing (old code):
os (new code):
os.cpu_count() is already implemented with GetSystemInfo() in Python 3.5, so this issue can be closed. Thanks for the reminder Mark, it was useful to double check.
If you want to take a look at the source code:
https://hg.python.org/cpython/file/35b7dde7fd53/Modules/posixmodule.c#l16064