Order of event handler execution

Phillip Ngan picture Phillip Ngan · Oct 29, 2009 · Viewed 47.5k times · Source

If I set up multiple event handlers, like so:

_webservice.RetrieveDataCompleted += ProcessData1;
_webservice.RetrieveDataCompleted += ProcessData2;

what order are the handlers run when the event RetrieveDataCompleted is fired? Are they run in the same thread and sequentially in the order that are registered?

Answer

Reed Copsey picture Reed Copsey · Oct 29, 2009

Currently, they are executed in the order they are registered. However, this is an implementation detail, and I would not rely on this behavior staying the same in future versions, since it is not required by specifications.