[python-win32] DispatchWithEvents design question

Richard Bell rbell01824 at earthlink.net
Tue Jun 5 22:45:44 CEST 2007


Thanks Tim.  

If PumpWaitingMessages is queued AND messages can only occur when
PumpWaitingMessages is called, then Questions 2 and 3 are resolved since
absent the call to PumpWaitingMessages events can not occur.  

I am still a bit concerned, however, because of an experiment I ran several
days ago, see "DispatchWithEvents experiment with subclass eventroutine and
pump messages" from 6/5.  In this experiment there were NO calls to
PumpWaitingMessages yet events/messages DID occur!  How sure are you?  FWIW,
memory serves that the OnVisible event is unique and doesn't have to be
pumped.  I do not remember where I read this or why it is so.  Such,
however, is NOT the case with OnDocumentComplete.  So I'm still a bit
uncertain.  

Do you know of any hard test to verify the behavior?

Regards,
Richard

|Tim Roberts, timr at probo.com
|Richard Bell wrote:
|> Question 3: Does PumpWaitingMessages insure that at MOST one
|message/event
|> is pumped such that reentrancy is not an issue?
|>
|
|I can't answer the other two questions, but I can answer this one,
|definitively yes.  A Windows message queue is associated with a single
|thread only, and only that thread can dispatch the messages.  It will
|not dispatch message #2 until message #1 has completed and returned.
|



More information about the Python-win32 mailing list