You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Advanced Debugger Support C-API is useless without HEAD_LOCK()/HEAD_UNLOCK() #85234
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=Noneclosed_at=Nonecreated_at=<Date2020-06-21.08:53:48.034>labels= ['expert-C-API', 'type-feature', '3.11']
title='Advanced Debugger Support C-API is useless without HEAD_LOCK()/HEAD_UNLOCK()'updated_at=<Date2021-12-06.18:25:56.506>user='https://github.com/AndreiPashkin'
* Because these lists can mutate even when the GIL is held, we
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.
Activity
AndreiPashkin commentedon Jun 21, 2020
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:
cpython/Python/pystate.c
Line 1176 in e838a93
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.
AndreiPashkin commentedon Jun 21, 2020
Here is what I mean by "Advanced Debugger Support" API:
https://docs.python.org/dev/c-api/init.html#advanced-debugger-support