Mailing List Archive

bpo-43293: Doc: move note about GIL to top of threading module (GH-24622)
https://github.com/python/cpython/commit/32181be6081f6c70a1e0bd0540050805c8e88e83
commit: 32181be6081f6c70a1e0bd0540050805c8e88e83
branch: master
author: Guanzhong Chen <quantum2048@gmail.com>
committer: pablogsal <Pablogsal@gmail.com>
date: 2021-02-24T18:39:38Z
summary:

bpo-43293: Doc: move note about GIL to top of threading module (GH-24622)

The note about the GIL was buried pretty deep in the threading documentation,
and this made it hard for first time users to discover why their attempts
at using threading to parallelizing their application did not work.

In this commit, the note is moved to the top of the module documention for
visibility.

files:
M Doc/library/threading.rst

diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst
index 690735469d0bf..bb982f2edcf1b 100644
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -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:


@@ -424,19 +437,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

_______________________________________________
Python-checkins mailing list
Python-checkins@python.org
https://mail.python.org/mailman/listinfo/python-checkins
bpo-43293: Doc: move note about GIL to top of threading module (GH-24622) [ In reply to ]
https://github.com/python/cpython/commit/2a9e6ab6adc82713e43cdf0aed09557d0d63e3bb
commit: 2a9e6ab6adc82713e43cdf0aed09557d0d63e3bb
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
committer: miss-islington <31488909+miss-islington@users.noreply.github.com>
date: 2021-02-24T10:49:19-08:00
summary:

bpo-43293: Doc: move note about GIL to top of threading module (GH-24622)


The note about the GIL was buried pretty deep in the threading documentation,
and this made it hard for first time users to discover why their attempts
at using threading to parallelizing their application did not work.

In this commit, the note is moved to the top of the module documention for
visibility.
(cherry picked from commit 32181be6081f6c70a1e0bd0540050805c8e88e83)

Co-authored-by: Guanzhong Chen <quantum2048@gmail.com>

files:
M Doc/library/threading.rst

diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst
index 4c78e6e12056a..235d5d3b2b04e 100644
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -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:


@@ -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

_______________________________________________
Python-checkins mailing list
Python-checkins@python.org
https://mail.python.org/mailman/listinfo/python-checkins
bpo-43293: Doc: move note about GIL to top of threading module (GH-24622) [ In reply to ]
https://github.com/python/cpython/commit/f82578ace103ec977cec3424b20e0b5f19cf720e
commit: f82578ace103ec977cec3424b20e0b5f19cf720e
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
committer: miss-islington <31488909+miss-islington@users.noreply.github.com>
date: 2021-02-24T11:01:33-08:00
summary:

bpo-43293: Doc: move note about GIL to top of threading module (GH-24622)


The note about the GIL was buried pretty deep in the threading documentation,
and this made it hard for first time users to discover why their attempts
at using threading to parallelizing their application did not work.

In this commit, the note is moved to the top of the module documention for
visibility.
(cherry picked from commit 32181be6081f6c70a1e0bd0540050805c8e88e83)

Co-authored-by: Guanzhong Chen <quantum2048@gmail.com>

files:
M Doc/library/threading.rst

diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst
index f4de3c4e0331a..2a42018b7bfc7 100644
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -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:


@@ -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

_______________________________________________
Python-checkins mailing list
Python-checkins@python.org
https://mail.python.org/mailman/listinfo/python-checkins