Changeset 81107 in vbox for trunk/src/VBox/ValidationKit/common
- Timestamp:
- Oct 4, 2019 1:41:17 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/common/utils.py
r79908 r81107 300 300 return sVersion; 301 301 302 def getPresentCpuCount(): 303 """ 304 Gets the number of CPUs present in the system. 305 306 This differs from multiprocessor.cpu_count() and os.cpu_count() on windows in 307 that we return the active count rather than the maximum count. If we don't, 308 we will end up thinking testboxmem1 has 512 CPU threads, which it doesn't and 309 never will have. 310 311 @todo This is probably not exactly what we get on non-windows... 312 """ 313 314 if getHostOs() == 'win': 315 fnGetActiveProcessorCount = getattr(ctypes.windll.kernel32, 'GetActiveProcessorCount', None); 316 if fnGetActiveProcessorCount: 317 cCpus = fnGetActiveProcessorCount(ctypes.c_ushort(0xffff)); 318 if cCpus > 0: 319 return cCpus; 320 321 import multiprocessor; 322 return multiprocessor.cpu_count(); 323 324 302 325 # 303 326 # File system.
Note:
See TracChangeset
for help on using the changeset viewer.