Skip to content

Commit 5a094f0

Browse files
gh-96098: Clearly link concurrent.futures from threading & multiprocessing docs (GH-96112)
Clearly link concurrent.futures from threading & multiprocessing docs Also link directly to asyncio from the beginning of the threading docs. (cherry picked from commit bcc4cb0) Co-authored-by: Nick Coghlan <[email protected]>
1 parent 442674e commit 5a094f0

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

Doc/library/multiprocessing.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@ will print to standard output ::
4343
[1, 4, 9]
4444

4545

46+
.. seealso::
47+
48+
:class:`concurrent.futures.ProcessPoolExecutor` offers a higher level interface
49+
to push tasks to a background process without blocking execution of the
50+
calling process. Compared to using the :class:`~multiprocessing.pool.Pool`
51+
interface directly, the :mod:`concurrent.futures` API more readily allows
52+
the submission of work to the underlying process pool to be separated from
53+
waiting for the results.
54+
55+
4656
The :class:`Process` class
4757
~~~~~~~~~~~~~~~~~~~~~~~~~~
4858

Doc/library/threading.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,23 @@
99
--------------
1010

1111
This module constructs higher-level threading interfaces on top of the lower
12-
level :mod:`_thread` module. See also the :mod:`queue` module.
12+
level :mod:`_thread` module.
1313

1414
.. versionchanged:: 3.7
1515
This module used to be optional, it is now always available.
1616

17+
.. seealso::
18+
19+
:class:`concurrent.futures.ThreadPoolExecutor` offers a higher level interface
20+
to push tasks to a background thread without blocking execution of the
21+
calling thread, while still being able to retrieve their results when needed.
22+
23+
:mod:`queue` provides a thread-safe interface for exchanging data between
24+
running threads.
25+
26+
:mod:`asyncio` offers an alternative approach to achieving task level
27+
concurrency without requiring the use of multiple operating system threads.
28+
1729
.. note::
1830

1931
In the Python 2.x series, this module contained ``camelCase`` names
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Improve discoverability of the higher level concurrent.futures module by
2+
providing clearer links from the lower level threading and multiprocessing
3+
modules.

0 commit comments

Comments
 (0)