Skip to content

Conversation

@1st1
Copy link
Member

@1st11st1 commented May 20, 2024

...as opposed to storing it in PyRuntime. Storing it in PyRuntime is fundametally wrong, as its state contains references to Python objects. Those objects (tuples and strings) can (and will) be picked by various subinterpreter clean up code, leaving PyRuntime with broken pointers.

...as opposed to storing it in PyRuntime. Storing it in PyRuntime is fundametally wrong, as its state contains references to Python objects. Those objects (tuples and strings) can (and will) be picked by various subinterpreter clean up code, leaving PyRuntime with broken pointers.
#include"pycore_unicodeobject.h"// struct _Py_unicode_runtime_ids

struct_getargs_runtime_state{
PyThread_type_lockmutex;
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having a lock isn't necessary in 3.12 as we're muving this struct to InterpreterState. Local state modification will be protected by the GIL.

@ericsnowcurrentlyericsnowcurrently changed the title Fix getargs.c to store state in InterpreterState...gh-119213: Fix getargs.c to store state in InterpreterState...May 20, 2024
@Eclips4Eclips4 changed the title gh-119213: Fix getargs.c to store state in InterpreterState...[3.12] gh-119213: Fix getargs.c to store state in InterpreterState...May 20, 2024
@ericsnowcurrently
Copy link
Member

superseded by gh-119425

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@1st1@ericsnowcurrently