Firing events on a differnet thread

  • Thread starter Thread starter Phil Jones
  • Start date Start date
P

Phil Jones

I've just been thinking about scenarious where firing an event causes a
number of handler to execute - all of them potentially taking some time to
complete. With a UI control, that could be a problem. The answer of course
is to use threads - but I was wondering what the rule of thumb was here.

I've steared clear form firing the event on a different thread as I could
see how that could begin to be a real nightmare to debug (so handle thread
creation/management by the various handers).

But I thought I'd ask. Firing the event on a different thread would be a
single clean place to create the new thread. Does anyone have any
opinions/advice here???

Thanks everyone.
===
Phil : NZ
 
You can fire the event on any thread you like, but you must access a control
only on the thread on which it was created. Fortunately there's a simple
pattern you can use to achieve this..
 
Back
Top