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 asvetlov, grahamd, ncoghlan, pitrou
Date 2012-08-24.12:35:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I'm not sure it makes sense to call this new API "PyGILState_EnsureEx". My concern is that the behaviour is quite different in the presence of an existing thread state:

- if a thread state exists, use that interpreter
- otherwise, use the default interpreter configured in the pystate.c globals

New API:
- if a thread state exists, and the interpreter doesn't match the requested one, fail with an error
- otherwise, use the requested interpreter

I guess it makes sense if we treat the NULL pointer as the degenerate case meaning "use the interpreter of this thread, or the default interpreter if no interpreter has been declared for this thread". PyGILState_Ensure would then simply call PyGILState_EnsureEx(NULL) internally.

So, my question for Graham would be, given this ability, would mod_wsgi still need the ability to change the default interpreter? Or would it be enough for you to be able to register the threads *you* create with a specific interpreter?
Date User Action Args
2012-08-24 12:35:56ncoghlansetrecipients: + ncoghlan, pitrou, grahamd, asvetlov
2012-08-24 12:35:56ncoghlansetmessageid: <>
2012-08-24 12:35:56ncoghlanlinkissue15751 messages
2012-08-24 12:35:55ncoghlancreate