Nick Coghlan added the comment:

Umm, no. The whole point of the GILState API is that you can call it from a 
thread which knows *nothing* about Python.

It will then use the *process global* state in the pystate.c statics to 
initialise that thread with a Python thread state. Currently, that thread state 
will always be for the main Python interpreter for the process.

All Graham wants is an officially supported way to change which interpreter the 
pystate.c globals reference *without* shutting down and reinitialising Python 
completely.

There are going to be limitations on how effective this will be - it still 
won't support *all* extension modules that use the PyGILState APIs. It will, 
however, support many more of them than the status quo (which is zero, unless 
you force your WSGI app to use the main interpreter, which has its own 
problems).

And you absolutely can control when the OS switches threads - controlling that 
is what synchronisation primitives are *for*.

----------

_______________________________________
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