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: Advanced Debugger Support C-API is useless without HEAD_LOCK()/HEAD_UNLOCK()
Type: enhancement Stage:
Components: C API Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: pashkin, vstinner
Priority: normal Keywords:

Created on 2020-06-21 08:53 by pashkin, last changed 2022-04-11 14:59 by admin.

Messages (2)
msg371988 - (view) Author: Andrei Pashkin (pashkin) Date: 2020-06-21 08:53
To me it seems like Advanced Debugger Support C-API doesn't make sense without HEAD_LOCK() and HEAD_UNLOCK() which are private right now.

When researching how C-API works I've found this comment in the source code:
https://github.com/python/cpython/blob/e838a9324c1719bb917ca81ede8d766b5cb551f4/Python/pystate.c#L1176

It says that the lists of interpreter-state and thread-state objects (that Adv. Debugger Support API operates on) could be mutated even when GIL is held so there is need to acquire head mutex when accessing them. But there is no way to acquire head mutex using public C-API.

Am I right? If yes - it seems like HEAD_(UN)LOCK() should be made public.
msg371989 - (view) Author: Andrei Pashkin (pashkin) Date: 2020-06-21 08:58
Here is what I mean by "Advanced Debugger Support" API:
https://docs.python.org/dev/c-api/init.html#advanced-debugger-support
History
Date User Action Args
2022-04-11 14:59:32adminsetgithub: 85234
2021-12-06 18:25:56iritkatrielsettype: behavior -> enhancement
versions: + Python 3.11, - Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9, Python 3.10
2021-10-21 15:18:04iritkatrielsetnosy: + vstinner
2020-06-21 08:58:57pashkinsetmessages: + msg371989
2020-06-21 08:53:48pashkincreate