How many threads are involved when a client receives an event?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to understand how many threads are involved when a client event
handler is called.

I am using a simple .net windows application. I click a button on a form
that triggers an event. The event delegate calls two event handlers in two
seperate object instances.

Are the event handlers getting called sequentially relative to the main
thread or are seperate threads being generated to handle the events?

Are there .net application settings that change this?

Your explanation will be appreciated.
 
Form (and its child controls) events are all called sequentially
(synchronously) within the main thread.

In order to have event code run in a separate thread, you must
explicitly code it to do so (using normal threading techniques).

Note, you should never update a form (or any control) from a different
thread.

Joshua Flanagan
http://flimflan.com/blog
 
Back
Top