Normalize heading underline in multiprocessing.rst (#114923)

This gets rid of the mildly confusing `>>>>>>>' underlines which look vaguely like `diff` punctuation.
This commit is contained in:
Skip Montanaro 2024-02-02 19:56:00 -06:00 committed by GitHub
parent f3cdd64de8
commit 00d7109075
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -56,7 +56,7 @@ will print to standard output ::
The :class:`Process` class The :class:`Process` class
~~~~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^
In :mod:`multiprocessing`, processes are spawned by creating a :class:`Process` In :mod:`multiprocessing`, processes are spawned by creating a :class:`Process`
object and then calling its :meth:`~Process.start` method. :class:`Process` object and then calling its :meth:`~Process.start` method. :class:`Process`
@ -102,7 +102,7 @@ necessary, see :ref:`multiprocessing-programming`.
.. _multiprocessing-start-methods: .. _multiprocessing-start-methods:
Contexts and start methods Contexts and start methods
~~~~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^
Depending on the platform, :mod:`multiprocessing` supports three ways Depending on the platform, :mod:`multiprocessing` supports three ways
to start a process. These *start methods* are to start a process. These *start methods* are
@ -231,7 +231,7 @@ library user.
Exchanging objects between processes Exchanging objects between processes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:mod:`multiprocessing` supports two types of communication channel between :mod:`multiprocessing` supports two types of communication channel between
processes: processes:
@ -283,7 +283,7 @@ processes:
Synchronization between processes Synchronization between processes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:mod:`multiprocessing` contains equivalents of all the synchronization :mod:`multiprocessing` contains equivalents of all the synchronization
primitives from :mod:`threading`. For instance one can use a lock to ensure primitives from :mod:`threading`. For instance one can use a lock to ensure
@ -309,7 +309,7 @@ mixed up.
Sharing state between processes Sharing state between processes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
As mentioned above, when doing concurrent programming it is usually best to As mentioned above, when doing concurrent programming it is usually best to
avoid using shared state as far as possible. This is particularly true when avoid using shared state as far as possible. This is particularly true when
@ -399,7 +399,7 @@ However, if you really do need to use some shared data then
Using a pool of workers Using a pool of workers
~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^
The :class:`~multiprocessing.pool.Pool` class represents a pool of worker The :class:`~multiprocessing.pool.Pool` class represents a pool of worker
processes. It has methods which allows tasks to be offloaded to the worker processes. It has methods which allows tasks to be offloaded to the worker
@ -490,7 +490,7 @@ The :mod:`multiprocessing` package mostly replicates the API of the
:class:`Process` and exceptions :class:`Process` and exceptions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. class:: Process(group=None, target=None, name=None, args=(), kwargs={}, \ .. class:: Process(group=None, target=None, name=None, args=(), kwargs={}, \
*, daemon=None) *, daemon=None)
@ -724,7 +724,7 @@ The :mod:`multiprocessing` package mostly replicates the API of the
Raised by methods with a timeout when the timeout expires. Raised by methods with a timeout when the timeout expires.
Pipes and Queues Pipes and Queues
~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^
When using multiple processes, one generally uses message passing for When using multiple processes, one generally uses message passing for
communication between processes and avoids having to use any synchronization communication between processes and avoids having to use any synchronization
@ -981,7 +981,7 @@ For an example of the usage of queues for interprocess communication see
Miscellaneous Miscellaneous
~~~~~~~~~~~~~ ^^^^^^^^^^^^^
.. function:: active_children() .. function:: active_children()
@ -1150,7 +1150,7 @@ Miscellaneous
Connection Objects Connection Objects
~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^
.. currentmodule:: multiprocessing.connection .. currentmodule:: multiprocessing.connection
@ -1292,7 +1292,7 @@ For example:
Synchronization primitives Synchronization primitives
~~~~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^
.. currentmodule:: multiprocessing .. currentmodule:: multiprocessing
@ -1481,7 +1481,7 @@ object -- see :ref:`multiprocessing-managers`.
Shared :mod:`ctypes` Objects Shared :mod:`ctypes` Objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
It is possible to create shared objects using shared memory which can be It is possible to create shared objects using shared memory which can be
inherited by child processes. inherited by child processes.
@ -1543,7 +1543,7 @@ inherited by child processes.
The :mod:`multiprocessing.sharedctypes` module The :mod:`multiprocessing.sharedctypes` module
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> """"""""""""""""""""""""""""""""""""""""""""""
.. module:: multiprocessing.sharedctypes .. module:: multiprocessing.sharedctypes
:synopsis: Allocate ctypes objects from shared memory. :synopsis: Allocate ctypes objects from shared memory.
@ -1709,7 +1709,7 @@ The results printed are ::
.. _multiprocessing-managers: .. _multiprocessing-managers:
Managers Managers
~~~~~~~~ ^^^^^^^^
Managers provide a way to create data which can be shared between different Managers provide a way to create data which can be shared between different
processes, including sharing over a network between processes running on processes, including sharing over a network between processes running on
@ -1954,7 +1954,7 @@ their parent process exits. The manager classes are defined in the
Customized managers Customized managers
>>>>>>>>>>>>>>>>>>> """""""""""""""""""
To create one's own manager, one creates a subclass of :class:`BaseManager` and To create one's own manager, one creates a subclass of :class:`BaseManager` and
uses the :meth:`~BaseManager.register` classmethod to register new types or uses the :meth:`~BaseManager.register` classmethod to register new types or
@ -1981,7 +1981,7 @@ callables with the manager class. For example::
Using a remote manager Using a remote manager
>>>>>>>>>>>>>>>>>>>>>> """"""""""""""""""""""
It is possible to run a manager server on one machine and have clients use it It is possible to run a manager server on one machine and have clients use it
from other machines (assuming that the firewalls involved allow it). from other machines (assuming that the firewalls involved allow it).
@ -2044,7 +2044,7 @@ client to access it remotely::
.. _multiprocessing-proxy_objects: .. _multiprocessing-proxy_objects:
Proxy Objects Proxy Objects
~~~~~~~~~~~~~ ^^^^^^^^^^^^^
A proxy is an object which *refers* to a shared object which lives (presumably) A proxy is an object which *refers* to a shared object which lives (presumably)
in a different process. The shared object is said to be the *referent* of the in a different process. The shared object is said to be the *referent* of the
@ -2196,7 +2196,7 @@ demonstrates a level of control over the synchronization.
Cleanup Cleanup
>>>>>>> """""""
A proxy object uses a weakref callback so that when it gets garbage collected it A proxy object uses a weakref callback so that when it gets garbage collected it
deregisters itself from the manager which owns its referent. deregisters itself from the manager which owns its referent.
@ -2206,7 +2206,7 @@ any proxies referring to it.
Process Pools Process Pools
~~~~~~~~~~~~~ ^^^^^^^^^^^^^
.. module:: multiprocessing.pool .. module:: multiprocessing.pool
:synopsis: Create pools of processes. :synopsis: Create pools of processes.
@ -2442,7 +2442,7 @@ The following example demonstrates the use of a pool::
.. _multiprocessing-listeners-clients: .. _multiprocessing-listeners-clients:
Listeners and Clients Listeners and Clients
~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^
.. module:: multiprocessing.connection .. module:: multiprocessing.connection
:synopsis: API for dealing with sockets. :synopsis: API for dealing with sockets.
@ -2665,7 +2665,7 @@ wait for messages from multiple processes at once::
.. _multiprocessing-address-formats: .. _multiprocessing-address-formats:
Address Formats Address Formats
>>>>>>>>>>>>>>> """""""""""""""
* An ``'AF_INET'`` address is a tuple of the form ``(hostname, port)`` where * An ``'AF_INET'`` address is a tuple of the form ``(hostname, port)`` where
*hostname* is a string and *port* is an integer. *hostname* is a string and *port* is an integer.
@ -2685,7 +2685,7 @@ an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address.
.. _multiprocessing-auth-keys: .. _multiprocessing-auth-keys:
Authentication keys Authentication keys
~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^
When one uses :meth:`Connection.recv <Connection.recv>`, the When one uses :meth:`Connection.recv <Connection.recv>`, the
data received is automatically data received is automatically
@ -2711,7 +2711,7 @@ Suitable authentication keys can also be generated by using :func:`os.urandom`.
Logging Logging
~~~~~~~ ^^^^^^^
Some support for logging is available. Note, however, that the :mod:`logging` Some support for logging is available. Note, however, that the :mod:`logging`
package does not use process shared locks so it is possible (depending on the package does not use process shared locks so it is possible (depending on the
@ -2759,7 +2759,7 @@ For a full table of logging levels, see the :mod:`logging` module.
The :mod:`multiprocessing.dummy` module The :mod:`multiprocessing.dummy` module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. module:: multiprocessing.dummy .. module:: multiprocessing.dummy
:synopsis: Dumb wrapper around threading. :synopsis: Dumb wrapper around threading.
@ -2818,7 +2818,7 @@ There are certain guidelines and idioms which should be adhered to when using
All start methods All start methods
~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^
The following applies to all start methods. The following applies to all start methods.
@ -2977,7 +2977,7 @@ Beware of replacing :data:`sys.stdin` with a "file like object"
For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331` For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`
The *spawn* and *forkserver* start methods The *spawn* and *forkserver* start methods
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
There are a few extra restriction which don't apply to the *fork* There are a few extra restriction which don't apply to the *fork*
start method. start method.