[python-win32] pythoncom multithread troubles
Kostas Eleftheriou
kostas.eleftheriou at gmail.com
Mon Nov 27 16:49:08 CET 2006
Hello Thomas,
Thanks for your quick reply. I do not marshal anything because I don't
need to pass objects between threads, each thread currently only deals
with its own objects. I have also tried using a surrogate process to
host the dll server (dllhost.exe) through the registry, but although
the server is now launched in a seperate process, I still only get one
process no matter how many DispatchEx calls I make from different
threads.
On 11/27/06, Thomas Heller <theller at ctypes.org> wrote:
> 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
>
> _______________________________________________
> Python-win32 mailing list
> Python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>
More information about the Python-win32
mailing list