Skip to content
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

Inconsistency in C-API thread docs #49548

Closed
osvenskan mannequin opened this issue Feb 17, 2009 · 2 comments
Closed

Inconsistency in C-API thread docs #49548

osvenskan mannequin opened this issue Feb 17, 2009 · 2 comments
Assignees
Labels
docs Documentation in the Doc dir

Comments

@osvenskan
Copy link
Mannequin

osvenskan mannequin commented Feb 17, 2009

BPO 5298
Nosy @birkenfeld, @osvenskan

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/birkenfeld'
closed_at = <Date 2009-04-05.17:17:55.390>
created_at = <Date 2009-02-17.20:42:08.513>
labels = ['docs']
title = 'Inconsistency in C-API thread docs'
updated_at = <Date 2009-04-05.17:17:55.388>
user = 'https://github.com/osvenskan'

bugs.python.org fields:

activity = <Date 2009-04-05.17:17:55.388>
actor = 'georg.brandl'
assignee = 'georg.brandl'
closed = True
closed_date = <Date 2009-04-05.17:17:55.390>
closer = 'georg.brandl'
components = ['Documentation']
creation = <Date 2009-02-17.20:42:08.513>
creator = 'osvenskan'
dependencies = []
files = []
hgrepos = []
issue_num = 5298
keywords = []
message_count = 2.0
messages = ['82365', '85528']
nosy_count = 2.0
nosy_names = ['georg.brandl', 'osvenskan']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue5298'
versions = ['Python 2.6', 'Python 2.5', 'Python 2.4', 'Python 3.0', 'Python 3.1', 'Python 2.7']

@osvenskan
Copy link
Mannequin Author

osvenskan mannequin commented Feb 17, 2009

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.

@osvenskan osvenskan mannequin assigned birkenfeld Feb 17, 2009
@osvenskan osvenskan mannequin added the docs Documentation in the Doc dir label Feb 17, 2009
@birkenfeld
Copy link
Member

Should be clearer as of r71251.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

1 participant