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

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

Joshua Flanagan

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
 

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

Top