Author ncoghlan
Recipients amaury.forgeotdarc, grahamd, loewis, mhammond, ncoghlan, pitrou
Date 2011-01-17.14:57:03
SpamBayes Score 2.16264e-08
Marked as misclassified No
Message-id <1295276226.15.0.311350204913.issue10915@psf.upfronthosting.co.za>
In-reply-to
Content
Graham - the cases you describe are the things I was saying don't currently work in my post and wouldn't be helped by Antoine's patch. Your thoughts on how we could possibly make it work actually parallel mine (although there may be fun and games with making sure the respective GILs are acquired and released in an appropriate order when switching interpreters).

However, if a given OS thread is created by a subinterpreter via thread_PyThread_start_new_thread, then the thread bootstrapping process will copy the thread state from that subinterpreter rather than the main interpreter.

Accordingly, the only thing that I believe should currently work with subinterpreters is the naive use case you described earlier (i.e. a call out to an extension module from a Python created thread that later calls back in using the PyGILState API in the exact same thread should work even in the presence of multiple interpreters).

This is the use case that I believe Antoine's patch as it currently stands actively *breaks* by making the autoTLSkey interpreter dependent.

Regardless, I'm marking 10914 as a dependency of this one, as I don't think we should change anything in this area until we have some unit tests to properly define what does and doesn't work. If we're going to promote subinterpreters to a robust, fully supported feature we may as well do it right.
History
Date User Action Args
2011-01-17 14:57:06ncoghlansetrecipients: + ncoghlan, loewis, mhammond, amaury.forgeotdarc, pitrou, grahamd
2011-01-17 14:57:06ncoghlansetmessageid: <1295276226.15.0.311350204913.issue10915@psf.upfronthosting.co.za>
2011-01-17 14:57:03ncoghlanlinkissue10915 messages
2011-01-17 14:57:03ncoghlancreate