All, I have a method that calls IProgress<T>.Report(); to update my UI and make a relevent data selection. The background thread subsequently picks up the current selection (on the UI) through an interface an works with it. Thus, it is important that the IProgress<T>.Report(); call blocks the return until the UI update is made. MSDN provides no information on this aspect of the Report(); method…
Does the Report(); method block the return to the background thread until the Report(); delegate is finshed?
Thanks for your time.
No, it doesn’t. It posts – instead of sends – to the synchronization context. A post is asynchronous.
Please note that this is an implementation detail. I learned it from reading the code, I am not aware of any official documentation regarding this.
Furthermore,
SynchronizationContext.Postis supposed to be asynchronous, but is not guaranteed to be. For example, in ASP.NET the delegate can be invoked directly, i.e. synchronous Reference: See Figure 4.