[Python-Dev] 'Subinterpreter' (was Re: Pre-PEP: Redesigning extension modules)
Stefan Behnel
stefan_ml at behnel.de
Sun Sep 1 23:13:36 CEST 2013
Antoine Pitrou, 01.09.2013 22:06:
> On Sun, 01 Sep 2013 16:02:33 -0400
> Terry Reedy wrote:
>>> Speaking of which, it also doesn't work (well) with subinterpreters:
>>
>> Could someone briefly explain 'subinterpreter' or point me somewhere in
>> the docs? It appears throughout this thread but there is no index or
>> glossary entry.
>
> http://docs.python.org/dev/c-api/init.html#sub-interpreter-support
>
> Subinterpreters are a somewhat borderline feature that allows embedding
> applications to host multiple Python programs in a single process. A
> well-known example is mod_wsgi.
And extension modules usually don't play well with subinterpreters because
each subinterpreter requires its own separate version of the module and
extension modules are rarely designed to keep their state completely local
to an interpreter, let alone being prepared for having their module init
function be called more than once.
Stefan
More information about the Python-Dev
mailing list