[issue24475] The docs never define what a pool "task" is

Zahari Dim report at bugs.python.org
Fri Jun 19 19:05:37 CEST 2015


New submission from Zahari Dim:

See:

http://stackoverflow.com/questions/30943161/multiprocessing-pool-with-maxtasksperchild-produces-equal-pids

The documentation never makes clear what a "task" in the context of Pool.map. At best, it says:

"This method chops the iterable into a number of chunks which it submits to the process pool as separate tasks. The (approximate) size of these chunks can be specified by setting chunksize to a positive integer."

in the map documentation. However it does not say how this chunks are calculated by default, making the maxtasksperchild argument not very useful. The fact that a function evaluated by map is not a "task" should be much clearer in the documentation.

Also, in the examples, such as:

 with multiprocessing.Pool(PROCESSES) as pool:
        #
        # Tests
        #

        TASKS = [(mul, (i, 7)) for i in range(10)] + \
                [(plus, (i, 8)) for i in range(10)]

        results = [pool.apply_async(calculate, t) for t in TASKS]
        imap_it = pool.imap(calculatestar, TASKS)
        imap_unordered_it = pool.imap_unordered(calculatestar, TASKS)

TASKS are not actually "tasks" but rather "task groups".

----------
assignee: docs at python
components: Documentation
messages: 245509
nosy: Zahari.Dim, docs at python
priority: normal
severity: normal
status: open
title: The docs never define what a pool "task" is
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24475>
_______________________________________


More information about the Python-bugs-list mailing list