Debian Codegraph @

testing/web-platform/tests/tools/manifest/mputil.py

raw
1 import multiprocessing
2 import sys
3
4 def max_parallelism() -> int:
5 cpu_count = multiprocessing.cpu_count()
6 if sys.platform == 'win32':
7 # On Python 3 on Windows, using >= MAXIMUM_WAIT_OBJECTS processes
8 # causes a crash in the multiprocessing module. Whilst this enum
9 # can technically have any value, it is usually 64. For safety,
10 # restrict manifest regeneration to 56 processes on Windows.
11 #
12 # See https://bugs.python.org/issue26903 and https://bugs.python.org/issue40263
13 cpu_count = min(cpu_count, 56)
14 return cpu_count