views:

43

answers:

2

Hi I've read all recommended articles on SynchronizationContext, but there is one small question I did not find an answer for. In my case I have an event handler that calls a Log() method that outputs text to a TextBox. Log() is called from a WCF service. The event is raised from WCF client instances (threads). Usually, I check Control.InvokeRequired to be sure I am on the correct thread.

Do I still need to do that when using SynchronizationContext? In other words, can I always do a .Post() or .Send() even if I'm already on the correct thread?

A: 

Using Post or Send if you're already on the correct thread is not necessary, but it will work

Thomas Levesque
A: 

Reading this and this would be useful.

Mehdi Sadeqi