[python-win32] pythoncom multithread troubles

Thomas Heller theller at ctypes.org
Mon Nov 27 15:39:07 CET 2006


Kostas Eleftheriou schrieb:
> Hi,
> 
> I have built a python application that uses a COM server from multiple
> threads, and despite some initial problems, I got it to work. I found
> out (the hard way) that the COM server would have undefined behaviour
> if some of its functions were called at the same time form multiple
> threads (so it was not thread-safe, although from the registry keys it
> looked as if it was), so I made the calls from my application
> sequential using locks etc.

The most important thing to remember is that you *MUST* marshal com pointers
correctly between the different com apartments.

Thomas



More information about the Python-win32 mailing list