Charles
Charles

Reputation: 6317

Silverlight Dispatcher event queue order

Is the Silverlight Dispatcher event queue's ordering strictly preserved?

To elaborate: If I have exactly one other thread calling Dispatcher.BeginInvoke, is it guaranteed that those calls will be processed on the UI thread in the same order, or is the ordering nondeterministic?

Upvotes: 5

Views: 769

Answers (1)

Kent Boogaart
Kent Boogaart

Reputation: 178740

From MSDN:

If multiple BeginInvoke calls are made at the same DispatcherPriority, they will be executed in the order the calls were made.

so, yes, if the same thread is queueing the messages, they will be executed in the order they are queued. That's assuming Silverlight follows the same rules (I'm assuming it does but it does not include an accessible DispatcherPriority) and the MSDN docs for Silverlight's BeginInvoke are rather light.

Upvotes: 6

Related Questions