Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF Dispatcher BeginInvoke ordering guarantee

Tags:

c#

wpf

If I call

Dispatcher.BeginInvoke(operation, DispatcherPriority.Loaded) 

1,000,000 times from over 20 threads, are those 1,000,000 operations guranteed to be executed by the UI thread in the order the BeginInvoke calls were made?

like image 718
Szymon Rozga Avatar asked Dec 21 '10 22:12

Szymon Rozga


1 Answers

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

But if you are accessing the Dispatcher from multiple thread then Any instance members are not guaranteed to be thread safe.

like image 117
alpha-mouse Avatar answered Sep 28 '22 18:09

alpha-mouse