How to prevent Events from being queued?

  • Thread starter Thread starter Ole
  • Start date Start date
O

Ole

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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top