Limit default MAX_CONCURRENCY to 4.

This commit is contained in:
homm 2014-12-08 22:15:44 +03:00
parent 2d2293ba3b
commit 83fc485392
3 changed files with 5 additions and 9 deletions

View File

@ -3,8 +3,6 @@ language: python
notifications:
irc: "chat.freenode.net#pil"
env: MAX_CONCURRENCY=4
# Run slow PyPy* first, to give them a headstart and reduce waiting time.
# Run latest 3.x and 2.x next, to get quick compatibility results.
# Then run the remainder.

View File

@ -97,11 +97,9 @@ Build Options
-------------
* Environment Variable: ``MAX_CONCURRENCY=n``. By default, Pillow will
use multiprocessing to build the extension in parallel. This may not
be ideal for machines that report a large number of cores compared
to the actual processor power. Set ``MAX_CONCURRENCY`` to 1 to disable
parallel building, or to a larger number to limit to that number of
parallel tasks.
use multiprocessing to build the extension on all available CPU,
but not more than 4. Setting ``MAX_CONCURRENCY`` to 1 will disable
parallel building.
* Build flags: ``--disable-zlib``, ``--disable-jpeg``,
``--disable-tiff``, ``--disable-freetype``, ``--disable-tcl``,

View File

@ -6,8 +6,8 @@ from distutils.ccompiler import CCompiler
import os, sys
try:
MAX_PROCS = int(os.environ.get('MAX_CONCURRENCY', cpu_count()))
except:
MAX_PROCS = int(os.environ.get('MAX_CONCURRENCY', min(4, cpu_count())))
except NotImplementedError:
MAX_PROCS = None