Re: How to prevent Events from being queued?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



This is not necesarily a solution it depends on how the event is being
dispatched.

The event could be dispatched concurrently on multiple threads in which case
you code could still end up being re-entrant.

Cheers,

Greg Young
MVP - C#
http://codebetter.com/blogs/gregyoung
"Ole" <ole@xxxxxxxxxx> wrote in message
news:%23ux1C7EnGHA.1248@xxxxxxxxxxxxxxxxxxxxxxx
OK - found a solution - I just disabled the event as soon as entering the
handler and enabled it at the end again - works well!

Ole

"Ole" <ole@xxxxxxxxxx> wrote in message
news:OEvYb3EnGHA.816@xxxxxxxxxxxxxxxxxxxxxxx
The pin_changed event from serial port is being queued while the
eventhandler is busy, but how do I change it so that the new event is
ignored instead while eventhandler is busy (I want to eliminate switch
noise)?

Thanks
Ole





.



Relevant Pages

  • Re: How can i implement a message pump with winforms ?
    ... |>// keep the busy ... | see in my last post, i'm returning a list, that is built in the ...
    (microsoft.public.dotnet.languages.vc)
  • Re: How to prevent Events from being queued?
    ... OK - found a solution - I just disabled the event as soon as entering the ... handler and enabled it at the end again - works well! ... ignored instead while eventhandler is busy (I want to eliminate switch ...
    (microsoft.public.dotnet.languages.csharp)
  • How to prevent Events from being queued?
    ... The pin_changed event from serial port is being queued while the ... ignored instead while eventhandler is busy (I want to eliminate switch ... Ole ...
    (microsoft.public.dotnet.languages.csharp)