Skip to content

[3.9] bpo-43293: Doc: move note about GIL to top of threading module (GH-24622) #24640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions Doc/library/threading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ level :mod:`_thread` module. See also the :mod:`queue` module.
supported by this module.


.. impl-detail::

In CPython, due to the :term:`Global Interpreter Lock
<global interpreter lock>`, only one thread
can execute Python code at once (even though certain performance-oriented
libraries might overcome this limitation).
If you want your application to make better use of the computational
resources of multi-core machines, you are advised to use
:mod:`multiprocessing` or :class:`concurrent.futures.ProcessPoolExecutor`.
However, threading is still an appropriate model if you want to run
multiple I/O-bound tasks simultaneously.


This module defines the following functions:


Expand Down Expand Up @@ -393,19 +406,6 @@ since it is impossible to detect the termination of alien threads.
property instead.


.. impl-detail::

In CPython, due to the :term:`Global Interpreter Lock
<global interpreter lock>`, only one thread
can execute Python code at once (even though certain performance-oriented
libraries might overcome this limitation).
If you want your application to make better use of the computational
resources of multi-core machines, you are advised to use
:mod:`multiprocessing` or :class:`concurrent.futures.ProcessPoolExecutor`.
However, threading is still an appropriate model if you want to run
multiple I/O-bound tasks simultaneously.


.. _lock-objects:

Lock Objects
Expand Down