[issue5840] "Thread State and the Global Interpreter Lock" section of the docs doesn't cover TLS APIs

2021-06-20 Thread Irit Katriel


Irit Katriel  added the comment:

Indeed, this API was deprecated in 3.7:

https://docs.python.org/3/c-api/init.html#thread-local-storage-tls-api

--
nosy: +iritkatriel
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5840] "Thread State and the Global Interpreter Lock" section of the docs doesn't cover TLS APIs

2018-02-25 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I believe this issue is superseded by PEP539 and issue25658?

--
nosy: +csabella

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5840] Thread State and the Global Interpreter Lock section of the docs doesn't cover TLS APIs

2011-01-03 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Actually, I don't think the TLS APIs should be documented. They are quite 
internal, and used only for the PyGILState APIs.

--
nosy: +pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5840
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5840] Thread State and the Global Interpreter Lock section of the docs doesn't cover TLS APIs

2011-01-03 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

They are used by pyOpenSSL and pygobject/pyglib, though :/

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5840
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5840] Thread State and the Global Interpreter Lock section of the docs doesn't cover TLS APIs

2009-04-27 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Committed init.rst.diff in r72037.  Next step: document TLS APIs.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5840
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5840] Thread State and the Global Interpreter Lock section of the docs doesn't cover TLS APIs

2009-04-25 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone exar...@divmod.com:

Python includes several APIs for manipulating TLS:

  PyAPI_FUNC(int) PyThread_create_key(void);
  PyAPI_FUNC(void) PyThread_delete_key(int);
  PyAPI_FUNC(int) PyThread_set_key_value(int, void *);
  PyAPI_FUNC(void *) PyThread_get_key_value(int);
  PyAPI_FUNC(void) PyThread_delete_key_value(int key);

These are not covered in the threading documentation, though.  In fact,
the threading documentation goes so far as to claim that they /don't/ exist:

While most thread packages have a way to store “per-thread global
data,” Python’s internal platform independent thread abstraction doesn’t
support this yet.

It would be great to have these APIs covered in the documentation.  One
subtlety in particular tripped me up and took a long time to track down
by reading various parts of the CPython source - when a thread exits,
its TLS values are not destroyed or reclaimed in any way.  On top of
this, the keys used by the TLS APIs are thread IDs, and thread IDs can
be re-used.  This means that a newer thread can see values from an older
thread in TLS, which was extremely surprising to me, led to a very
obscure threading bug.

--
assignee: georg.brandl
components: Documentation
messages: 86501
nosy: exarkun, georg.brandl
severity: normal
status: open
title: Thread State and the Global Interpreter Lock section of the docs 
doesn't cover TLS APIs
type: feature request

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5840
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5840] Thread State and the Global Interpreter Lock section of the docs doesn't cover TLS APIs

2009-04-25 Thread Jeroen Ruigrok van der Werven

Jeroen Ruigrok van der Werven asmo...@in-nomine.org added the comment:

This is at least relevant to 2.7, reflect this in the issue.

Patch to remove the notion we don't support TLS yet.

We will need to see where to add the current functions in the overall
scheme of threading documentation.

--
keywords: +patch
nosy: +asmodai
stage:  - needs patch
versions: +Python 2.7
Added file: http://bugs.python.org/file13767/init.rst.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5840
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5840] Thread State and the Global Interpreter Lock section of the docs doesn't cover TLS APIs

2009-04-25 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Looks good.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5840
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com