


Any code invoked in this manner is always executed by a specific thread (the UI thread), which avoids the use for thread sychronising code. To avoid having to write thread-safe code, people writing a WPF app might use Dispatcher.Invoke to ensure the UI thread executes the code, and WinForms developers might use the Invoke method of the form. A data push from another server we’ve connected to via a Web Socket.An event triggered by another thread on a Singleton instance shared by multiple users.In circumstances where our code is called by a non-UI event (such as the ones outlined in Multi-threaded rendering), we would ordinarily need to implement some kind of thread locking/synchronisation if we intend to manipulate state.
