Possible Duplicate:
Order of event handler execution
Is the C# event system deterministic for single-thread programs? That means, if I fire events A, B, and C in this order, will they be processed in the same order, every time?
I want to write a game logic which is heavily dependent on events, and it is crucial that the events are processed in exactly the order in which they are called. So can I use the given event system, does a library like Reactive Extensions satisfy this, or do I have to implement my own observer system?
[ for single-thread programs, ] if I fire events A, B, and C in this order, will they be processed in the same order, every time?
Yes. Firing an event is just a complicated way to call a method. So it's equivalent to:
On a single thread, if I call methods
A()
,B()
and thenC()
will they execute in that order?
Of course they will.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With