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.

Author ncoghlan
Recipients grahamd, ncoghlan, pitrou
Date 2012-08-21.13:21:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
It would twiddle the autoInterpreterState and autoTLSkey entries in the pystate.c global variables to point to a different subinterpreter.

As I understand the situation, mod_wsgi doesn't need arbitrary externally created threads to be able to call back into arbitrary subinterpreters, it just needs to be able to direct externally created threads in a process to a subinterpreter other than the main one.

Graham, looking at the current impl - have you experimented with just calling _PyGILState_Init() with the interpreter state and current thread state for the desired subinterpreter to see what happens?

I think the new method could just be a cleaner combination of _PyGILState_ReInit and _PyGILState_Init. If I'm right, then calling _PyGILState_Init should convert the current crashes and deadlocks into a relatively less harmful memory leak (since the old entry in the TLS won't get deleted properly).
Date User Action Args
2012-08-21 13:21:30ncoghlansetrecipients: + ncoghlan, pitrou, grahamd
2012-08-21 13:21:30ncoghlansetmessageid: <>
2012-08-21 13:21:29ncoghlanlinkissue15751 messages
2012-08-21 13:21:28ncoghlancreate