Is the C# event system deterministic for single

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 then C() will they execute in that order?

Of course they will.

链接地址: http://www.djcxy.com/p/11674.html

上一篇: 在Spring 3.2上为JUnits设置会话属性

下一篇: C#事件系统对于单个事件是确定性的