Nick Coghlan added the comment:

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:

Ensure:
- 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?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15751>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to