[issue18620] multiprocessing page leaves out important part of Pool example

2016-01-21 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Davin. I tweaked code style a bit and removed trailing 
whitespaces.

--
nosy: +berker.peksag
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18620] multiprocessing page leaves out important part of Pool example

2016-01-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c89f4f59872f by Berker Peksag in branch '3.5':
Issue #18620: Improve Pool examples in multiprocessing documentation
https://hg.python.org/cpython/rev/c89f4f59872f

New changeset 9f201578d8d9 by Berker Peksag in branch 'default':
Issue #18620: Improve Pool examples in multiprocessing documentation
https://hg.python.org/cpython/rev/9f201578d8d9

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18620] multiprocessing page leaves out important part of Pool example

2016-01-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9480e217ade0 by Berker Peksag in branch '2.7':
Issue #18620: Improve Pool examples in multiprocessing documentation
https://hg.python.org/cpython/rev/9480e217ade0

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18620] multiprocessing page leaves out important part of Pool example

2015-11-19 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: docs@python -> rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18620] multiprocessing page leaves out important part of Pool example

2015-09-20 Thread Davin Potts

Changes by Davin Potts :


--
versions: +Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18620] multiprocessing page leaves out important part of Pool example

2015-03-26 Thread Davin Potts

Changes by Davin Potts pyt...@discontinuity.net:


--
nosy: +rhettinger

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18620
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18620] multiprocessing page leaves out important part of Pool example

2015-03-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +jnoller, sbt

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18620
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18620] multiprocessing page leaves out important part of Pool example

2015-02-06 Thread Davin Potts

Davin Potts added the comment:

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.

--
keywords: +patch
stage:  - patch review
Added file: http://bugs.python.org/file38029/issue18620_py35.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18620
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18620] multiprocessing page leaves out important part of Pool example

2015-02-06 Thread Davin Potts

Changes by Davin Potts pyt...@discontinuity.net:


Added file: http://bugs.python.org/file38031/issue18620_py27.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18620
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18620] multiprocessing page leaves out important part of Pool example

2015-02-06 Thread Davin Potts

Changes by Davin Potts pyt...@discontinuity.net:


Added file: http://bugs.python.org/file38030/issue18620_py34.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18620
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18620] multiprocessing page leaves out important part of Pool example

2015-01-29 Thread Davin Potts

Changes by Davin Potts pyt...@discontinuity.net:


--
nosy: +davin

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18620
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18620] multiprocessing page leaves out important part of Pool example

2014-08-07 Thread Mark Lawrence

Mark Lawrence added the comment:

Looks as if the v2 and v3 docs need changing.

--
nosy: +BreamoreBoy
type: enhancement - behavior
versions: +Python 2.7, Python 3.4, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18620
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18620] multiprocessing page leaves out important part of Pool example

2013-08-01 Thread Chris Curvey

New submission from Chris Curvey:

on http://docs.python.org/2/library/multiprocessing.html, there is a bit about 
how to use a Pool properly, which looks like this

pool = Pool(processes=4)  # start 4 worker processes
result = pool.apply_async(f, [10])

What this neglects to mention is that only one process will get any of the 
work.  If you really want four processes in the pool to work, you have to call 
apply_async four times.  For example:

results = []
pool = Pool(processes=4)
for i in xrange(4):
results.append(pool.apply_async(f, [10]))

hat tip to 
http://stackoverflow.com/questions/12483512/python-multiprocessing-apply-async-only-uses-one-process

--
assignee: docs@python
components: Documentation
messages: 194115
nosy: Chris.Curvey, docs@python
priority: normal
severity: normal
status: open
title: multiprocessing page leaves out important part of Pool example
type: enhancement

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18620
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com