Open ericsnowcurrently opened 4 days ago
@Yhg1s, this changes only internal ABI, so we should be fine updating the ABI data file, right?
Yes, the struct is always allocated by the runtime, and the new field is used only by the runtime, never extension modules, so updating the ABI definition is fine.
This approach eliminates the originally reported race. It also gets rid of the deadlock reported in gh-96071, so we can remove the workaround added then.
This is mostly a cherry-pick of 1c0a104eca189a932e0b44ca9bef46cce3d0b801 (AKA gh-126989). The difference is we add
PyInterpreterState.threads_preallocated
at the end ofPyInterpreterState
, instead of addingPyInterpreterState.threads.preallocated
. That avoids ABI disruption.