This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Inconsistency in C-API thread docs
Type: Stage:
Components: Documentation Versions: Python 3.0, Python 2.4, Python 3.1, Python 2.7, Python 2.6, Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, osvenskan
Priority: normal Keywords:

Created on 2009-02-17 20:42 by osvenskan, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg82365 - (view) Author: Philip Semanchuk (osvenskan) * Date: 2009-02-17 20:42
The language in the threading API documentation is a little
inconsistent. The section I'm talking about is here:
http://docs.python.org/c-api/init.html#thread-state-and-the-global-interpreter-lock

The GIL is variously referred to as "global lock", "interpreter lock",
"global interpreter lock", "GIL", and simply "the lock". Given the
infamy of the GIL, one might expect all of these to be equally clear.
But as someone coding to this API for the first time, I had plenty to
learn already and the need to ensure that all of these referred to the
same singleton was distracting.

This documentation begins, "The Python interpreter is not fully thread
safe. In order to support multi-threaded Python programs, there's a
global lock that must be held by the current thread before it can safely
access Python objects. Without the lock..."

My suggestion is to alter the second sentence to the following:
"Without this lock (called the global interpreter lock, or GIL for
short)...."

All subsequent documentation references to "interpreter lock", "global
interpreter lock", and "lock" should be changed to "GIL". It would be
nice if the API referred to it consistently (e.g. PyEval_AcquireLock()
versus PyGILState_Ensure()) but that would require an interface change
which is obviously out of the question.
msg85528 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-04-05 17:17
Should be clearer as of r71251.
History
Date User Action Args
2022-04-11 14:56:45adminsetgithub: 49548
2009-04-05 17:17:55georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg85528
2009-02-17 20:42:08osvenskancreate