pythoncom: STA python COM server randomly does not receive event from other objects : deadlock 
Author Message
 pythoncom: STA python COM server randomly does not receive event from other objects : deadlock

Hi all,

I coded a python COM object that runs in a pythonw local server as a
STA.

This object creates and advises a VC++ COM object to receive its
event. Those events are sent by worker threads.

The VC++ object is free threaded. As a consequence call between my STA
python object and apartment are marshalled through proxy.

The python COM object regularly calls a blocking method on the VC++
object to synchronize. But, as it is a cross apartment call, during
the call it can gets the event handler called thanks to the message
pump operated by COM.

But sometimes events are no received and it seems that I enter a
deadlock.
When I attach to the VC+ object, I can see that the thread that made
the Fire_XX is still waiting for the call to end.

Does somedy know the reason?

Does the COM message pump may be different from the pythoncom message
pump located in localserver.py : pythoncom.PumpMessages ?

Thanks in advance for any hint, because this is a very blocking issue
for my project.

Marc



Sun, 15 Jan 2006 17:19:13 GMT  
 pythoncom: STA python COM server randomly does not receive event from other objects : deadlock
I'd like to add that just setting the Python COM object to Inproc
instead of Local server makes the all thing work properly.
But I need a Local server...

It works without modifying a line of code!

Marc

Quote:

> Hi all,

> I coded a python COM object that runs in a pythonw local server as a
> STA.

> This object creates and advises a VC++ COM object to receive its
> event. Those events are sent by worker threads.

> The VC++ object is free threaded. As a consequence call between my STA
> python object and apartment are marshalled through proxy.

> The python COM object regularly calls a blocking method on the VC++
> object to synchronize. But, as it is a cross apartment call, during
> the call it can gets the event handler called thanks to the message
> pump operated by COM.

> But sometimes events are no received and it seems that I enter a
> deadlock.
> When I attach to the VC+ object, I can see that the thread that made
> the Fire_XX is still waiting for the call to end.

> Does somedy know the reason?

> Does the COM message pump may be different from the pythoncom message
> pump located in localserver.py : pythoncom.PumpMessages ?

> Thanks in advance for any hint, because this is a very blocking issue
> for my project.

> Marc



Sun, 15 Jan 2006 21:59:47 GMT  
 pythoncom: STA python COM server randomly does not receive event from other objects : deadlock
It's me again.

I found the reason and wanted to share it with you.

It is a Windows 2000 bug corrected with service pack 4.

http://support.microsoft.com/default.aspx?scid=kb;en-us;321788

Indeed, my python COM object and its python client redirect stdout to
my own Trace Manager.

Hope it may help someone else.

Marc

Quote:

> I'd like to add that just setting the Python COM object to Inproc
> instead of Local server makes the all thing work properly.
> But I need a Local server...

> It works without modifying a line of code!

> Marc


> > Hi all,

> > I coded a python COM object that runs in a pythonw local server as a
> > STA.

> > This object creates and advises a VC++ COM object to receive its
> > event. Those events are sent by worker threads.

> > The VC++ object is free threaded. As a consequence call between my STA
> > python object and apartment are marshalled through proxy.

> > The python COM object regularly calls a blocking method on the VC++
> > object to synchronize. But, as it is a cross apartment call, during
> > the call it can gets the event handler called thanks to the message
> > pump operated by COM.

> > But sometimes events are no received and it seems that I enter a
> > deadlock.
> > When I attach to the VC+ object, I can see that the thread that made
> > the Fire_XX is still waiting for the call to end.

> > Does somedy know the reason?

> > Does the COM message pump may be different from the pythoncom message
> > pump located in localserver.py : pythoncom.PumpMessages ?

> > Thanks in advance for any hint, because this is a very blocking issue
> > for my project.

> > Marc



Mon, 16 Jan 2006 17:49:03 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Doesn't receive any ActiveX events from COM-server

2. Catch COM events generated by a Python COM server with Visual Basic

3. Events with Python COM local server

4. Receiving a COM event from a DLL in LabView

5. Open event not received

6. RANDOMLY RECEIVING ERROR Corruption detected DBF/NTX

7. how to register COM interface from python COM-server

8. COM server in python - howto restart server

9. Receiving Apple Events in a RB app (HandleAppleEvent event)

10. Only One Tkinter Entry can receive key event event in Linux RH8.0

11. COM server publishing events

12. COM server events

 

 
Powered by phpBB® Forum Software