[python-win32] Re: how to load 2 python COM DLLs in single app?

Mark Hammond mhammond at skippinet.com.au
Mon Oct 25 12:55:53 CEST 2004


> I am trying to grok Phillip J. Eby's ideas and produce
> something about Py_NewInterpreter.

Multiple interpreter states are effectively deprecated.  There are a number
of known issues, including that the PyGILState APIs don't work them (for the
exact reason that they are effectively deprecated!)  Guido, Tim Peters and I
discussed this in the process of putting together the GILState APIs.  The
PyWin32 extensions, and py2exe, use PyGILState.

Ultimately, the problem is that everyone has punted on multiple-interpreter
issues.  A correct solution requires fundamental changes to the Python
import mechanism (eg, C extension modules with "globals" would need to
become interpreter-state aware).  The problem is effectively the same as
multiple init/finalize sequences not being able to work correctly/cleanly.

I don't have any specific recommendation, but you should be aware of the
general problem, and the general lack of momentum in any solution :(  As
Thomas mentioned, completely independent Python instances via static linking
is probably the most realistic, even if ugly option.

Mark



More information about the Python-win32 mailing list