Skip to content

Commit 88cc10a

Browse files
committed
Remove ambiguity in buffersize description.
Previously it was a bit ambigious to say "pass this to fully utilize pool's capacity" as the fastest way would still be not passing `buffersize` at all. Now this section clearly says "... when using this feature".
1 parent 816fb6c commit 88cc10a

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Doc/library/multiprocessing.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2466,9 +2466,10 @@ with the :class:`Pool` class.
24662466
*buffersize* is specified to limit the number of submitted tasks whose
24672467
results have not yet been yielded. If the buffer is full, iteration over
24682468
the *iterables* pauses until a result is yielded from the buffer.
2469-
To fully utilize pool's capacity, set *buffersize* to the number of
2470-
processes in pool (to consume *iterable* as you go) or even higher
2471-
(to prefetch *buffersize - processes* arguments).
2469+
To fully utilize pool's capacity when using this feature,
2470+
set *buffersize* at least to the number of processes in pool
2471+
(to consume *iterable* as you go), or even higher
2472+
(to prefetch the next ``N=buffersize-processes`` arguments).
24722473

24732474
.. versionadded:: 3.15
24742475
Added the *buffersize* parameter.

Misc/NEWS.d/next/Library/2025-07-28-00-37-22.gh-issue-64192.iCGeQ5.rst renamed to Misc/NEWS.d/next/Library/2025-07-28-11-00-49.gh-issue-64192.7htLtg.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Add the optional ``buffersize`` parameter to
33
:meth:`multiprocessing.pool.Pool.imap_unordered` to limit the number of
44
submitted tasks whose results have not yet been yielded. If the buffer is
55
full, iteration over the *iterables* pauses until a result is yielded from
6-
the buffer. To fully utilize pool's capacity, set *buffersize* to the number
7-
of processes in pool (to consume *iterable* as you go) or even higher (to
8-
prefetch *buffersize - processes* arguments).
6+
the buffer. To fully utilize pool's capacity when using this feature, set
7+
*buffersize* at least to the number of processes in pool (to consume
8+
*iterable* as you go), or even higher (to prefetch the next
9+
``N=buffersize-processes`` arguments).

0 commit comments

Comments
 (0)