This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author davin
Recipients BreamoreBoy, Chris.Curvey, davin, docs@python
Date 2015-02-06.21:11:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1423257104.72.0.935581386583.issue18620@psf.upfronthosting.co.za>
In-reply-to
Content
Attached are proposed patches for 2.7, 3.4, and default (3.5) branches.

In these patches, the 2 examples in the documentation that showcase the use of pool.apply_async have been modified to specifically highlight that a single invocation of apply_async will only lead to a single process doing any work (not all of the pool's processes).

Specifically, in the first code example:
* In the 3.x branches, the example is expanded slightly to demonstrate that only a single process is used by a single apply_async call and that to accomplish similar to the mapping examples just above it, multiple apply_async calls are necessary.
* Also in the 3.x branches, the code deliberately causes an exception to be raised which will terminate the execution of this example when anyone attempts to run it.  Rather than provide an example which terminates prematurely, the exception is now caught and a message displayed to demonstrate the exception did indeed occur, permitting the example to run through to a successful exit.
* In the 2.7 branch, this first example is much smaller than what is in use in the 3.x branches -- I've expanded it to cover the same information as is being shared in the 3.x branches now.

Specifically, in the second code example:
* In the 3.x branches, the only change is to the comment to the right of the apply_async call which emphasizes that only a single process is being used.  Also, for clarity, the reference to the exception being raised in the last line was changed to highlight that it's an exception defined in the multiprocessing library (multiprocessing.TimeoutError).
* The 2.7 branch is the same -- there were no other differences on this example between branches.

These updated examples have been tested with the latest from 2.7, 3.4, and default/3.5 branches on OSX 10.10 and Windows 7.
History
Date User Action Args
2015-02-06 21:11:44davinsetrecipients: + davin, docs@python, BreamoreBoy, Chris.Curvey
2015-02-06 21:11:44davinsetmessageid: <1423257104.72.0.935581386583.issue18620@psf.upfronthosting.co.za>
2015-02-06 21:11:44davinlinkissue18620 messages
2015-02-06 21:11:44davincreate