summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-10-01 01:14:57 (GMT)
committerGitHub <noreply@github.com>2023-10-01 01:14:57 (GMT)
commita46e96076898d126c9f276aef1934195aac34b4e (patch)
treebeaec25a75f381f77b74bf4e164eb813c20ec81f /Lib/multiprocessing
parent53eb9a676f8c59b206dfc536b7590f6563ad65e0 (diff)
downloadcpython-a46e96076898d126c9f276aef1934195aac34b4e.zip
cpython-a46e96076898d126c9f276aef1934195aac34b4e.tar.gz
cpython-a46e96076898d126c9f276aef1934195aac34b4e.tar.bz2
gh-109649: Use os.process_cpu_count() (#110165)
Replace os.cpu_count() with os.process_cpu_count() in modules: * compileall * concurrent.futures * multiprocessing Replace os.cpu_count() with os.process_cpu_count() in programs: * _decimal deccheck.py test * freeze.py * multissltests.py * python -m test (regrtest) * wasm_build.py Other changes: * test.pythoninfo logs os.process_cpu_count(). * regrtest gets os.process_cpu_count() / os.cpu_count() in headers.
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r--Lib/multiprocessing/pool.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py
index 4f5d88c..f979890 100644
--- a/Lib/multiprocessing/pool.py
+++ b/Lib/multiprocessing/pool.py
@@ -200,7 +200,7 @@ class Pool(object):
self._initargs = initargs
if processes is None:
- processes = os.cpu_count() or 1
+ processes = os.process_cpu_count() or 1
if processes < 1:
raise ValueError("Number of processes must be at least 1")
if maxtasksperchild is not None: