Re: msgwaitformultipleobjects - loosing events ( i.e SetEvent - no eff



Don't confuse kernel events with Windows messages. They
are completely unrelated.

I suspect you have a bug in your code and erroneously reset
your event after you finish processing (perhaps in a different
section of your code). The fact your event is manual reset, when
it most likley needs to be auto reset, is a strong red flag pointing
towards my hypothesis.

The other issue is you have a race condition. I strongly suggest
you switch to using auto reset events and never reset them
manually.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://vcfaq.mvps.org
=====================================

"arun_msdn" <arun_msdn@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CA83CC5B-F69A-409A-903A-1D98B4A24997@xxxxxxxxxxxxxxxx
Hello,

I use msgwaitformultipleobjects to wait on a couple of events - triggered
by SetEvent
(manual reset events) & a 3 sec. timer ( using SetTimer). The timeout for
msgwaitformultipleobjects is 1 sec as well.

Thread type used is a worker thread.

I am seeing an unique behavior whereby if I have a blocking call while
processing one of the events
(requests off a STL msg. queue), in order to ensure that I dont hold up
the
thread, I process only certain # requests, then issue a ResetEvent &
SetEvent
so that I can process the rest later.

The problem I'm facing is the SetEvent that I issue seems to be dropped on
the floor since I never
get the event trigger through msgwaitformultipleobjects.

My guess is during the time I block on processing the incoming requests,
the timer events probably
fill up the maximum allowed limit of windows message/event queue for the
thread and hence drops any of
the newer requests.


Questions :

1. How can I find whats the maximum queue size per worker thread (windows
queue size per thread ) using which msgwaitformultipleobjects dispatches
events/windows messages ?
after which it will discard new SetEvents & other queueing of
events/messages.

Is there anyway to configure this ?

2. When can a (Worker) Thread loose messages and or events in general
while
dispatching through MsgWaitForMultipleObjects ?
I can think of some blocking call causing this effect due to the thread
technically becoming a (sort of) slow consumer.
In my case, this is what I think is happening.
Too many events into the msg. Q. (sort of fast producer).

Are there any other reasons ?

3. Can you point me to any resources that discusses the internals of how
MsgWaitForMultipleObjects works ?


4. Finally currently I use SetTimer to create timer events. This creates
the issue of the internal windows timer implementation
queueing up timer events while the thread is blocked processing
requests.

Is there a way either using SetTimer or some other call whereby I can
request a once only timer ?
This will help in not queueing up a whole lot of timers in the threads
queue.
I can request another timer event once I process the first one.


Any pointers to the above questions will really help.


Thanks,
Arun





.



Relevant Pages

  • reset a radio button
    ... to reset the first button back if a user so requests. ... This posting is provided "AS IS" with no warranties, and confers no rights. ... Prev by Date: ...
    (microsoft.public.scripting.vbscript)
  • Re: Bother with matching B/B router and Wireless box
    ... wireless router at the moment. ... Personal experience says you'll probably find it much easier using one ... if you haven't done so already holding the reset button for 5-10 seconds ... Most of the time I config routers web admin pages not to accept requests ...
    (uk.comp.sys.mac)
  • Re: how do i reset my tool bar?
    ... I am just guessing since you did not mention if it was in Word,Outlook,Excel etc ... Please Reply to Newsgroup for the benefit of others ... Requests for assistance by email can not and will not be acknowledged. ... i have tried everything i could think of including reset for the past ...
    (microsoft.public.office.setup)
  • Re: reset a radio button
    ... > to reset the first button back if a user so requests. ... Prev by Date: ...
    (microsoft.public.scripting.vbscript)
  • Form Authentication
    ... I implemented forms authentication but noticed that the session expires at ... even though requests are made. ... Do I have to place code to reset the Session timeout after every page ...
    (microsoft.public.dotnet.framework.aspnet)