A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2014-April/134352.html below:

[Python-Dev] API and process questions (sparked by Claudiu Popa on 16104

[Python-Dev] API and process questions (sparked by Claudiu Popa on 16104 [Python-Dev] API and process questions (sparked by Claudiu Popa on 16104Charles-François Natali cf.natali at gmail.com
Mon Apr 28 18:56:06 CEST 2014
>> (2)  The patch adds new functionality to use multiple processes in
>> parallel.  The normal parameter values are integers indicating how
>> many processes to use.  The parameter also needs two special values --
>> one to indicate "use os.cpu_count", and the other to indicate "don't
>> use multiprocessing at all".
>>
>> (A)  Is there a Best Practices for this situation, with two odd cases?
>
>
> No. In this situation I would consider 0 or -1 for "use os.cpu_count' and
> None for "don't use multi-processing".

Why would the user care if multiprocessing is used behind the scene?
It would be strange for processes=1 to fail if multiprocessing is not
available.

If you set a default value of 1, then compileall() will work
regardless of whether multiprocessing is available.

In short:
processes <= 0: use os.cpu_count()
processes == 1 (default): just use normal sequential compiling
processes > 1: use multiprocessing

There's no reason to introduce None. Or am I missing something?
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4