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
PyThreadState_IsCurrent bug under building Python with --with-experimental-isolated-subinterpreters #88540
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=<Date2021-06-10.10:14:52.708>labels= ['expert-subinterpreters', '3.11']
title='PyThreadState_IsCurrent bug under building Python with --with-experimental-isolated-subinterpreters'updated_at=<Date2021-06-10.10:14:52.708>user='https://github.com/JunyiXie'
under building Python with --with-experimental-isolated-subinterpreters
PyThreadState_IsCurrent use _PyRuntime.gilstate. is shared by multi sub interpreters.
Use interpreter gil->last_holder == state can fix it?
static int
PyThreadState_IsCurrent(PyThreadState *tstate)
{
/* Must be the tstate for this thread */
struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate;
assert(_PyGILState_GetThisThreadState(gilstate) == tstate);
return tstate == _PyRuntimeGILState_GetThreadState(gilstate);
}
static int
PyThreadState_IsCurrent(PyThreadState *tstate)
{
#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS
PyInterpreterState *interp = tstate->interp;
struct _ceval_state *ceval2 = &interp->ceval;
struct _gil_runtime_state *gil = &ceval2->gil;
return tstate == (PyThreadState*)_Py_atomic_load_relaxed(&gil->last_holder);
#else
/* Must be the tstate for this thread */
struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate;
assert(_PyGILState_GetThisThreadState(gilstate) == tstate);
return tstate == _PyRuntimeGILState_GetThreadState(gilstate);
#endif
}
Activity
JunyiXie commentedon Jun 10, 2021
under building Python with --with-experimental-isolated-subinterpreters
PyThreadState_IsCurrent use _PyRuntime.gilstate. is shared by multi sub interpreters.
Use interpreter
gil->last_holder == statecan fix it?kumaraditya303 commentedon Jul 10, 2022
Closing as EXPERIMENTAL_ISOLATED_SUBINTERPRETERS was removed in #93185