For this priority: Dispatcher.Invoke () and Dispatcher.BeginInvoke () equal?

Given that it Invoke()blocks the calling thread until the delegate is executed, I was wondering if it was given any priority over the queued delegates BeginInvoke(), which by definition would conclude that timeliness is less important?

Somebody knows? Yes, I could always hack a test application, but then I'm lazy; -)

+3
source share
2 answers

Dispatcher.Invoke () takes the first argument of DispatcherPriority. This is a relatively crude priority scheme. Otherwise, it functions as a FIFO queue, primarily serving first. With everything that makes sense, priority can only be significant if the call queue is backed up. The condition you want to avoid. And a rather unpleasant factory error, if it works that way, the code will execute in an unpredictable order depending on the speed and load of the machine.

+2
source

, BeginInvoke , Invoke() ( ). , BeginInvoke ( , ), , ...:)

+2

All Articles