Elaborate about the GIL.

This commit is contained in:
Antoine Pitrou 2011-01-06 16:31:28 +00:00
parent f8dc9ca84e
commit 003428158b
2 changed files with 35 additions and 13 deletions

View file

@ -17,11 +17,23 @@ The :mod:`dummy_threading` module is provided for situations where
methods and functions in this module in the Python 2.x series are still
supported by this module.
.. impl-detail::
Due to the :term:`Global Interpreter Lock`, in CPython 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 of 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.
.. seealso::
Latest version of the :source:`threading module Python source code
<Lib/threading.py>`
This module defines the following functions and objects: