Documentation: SynchronizationContext and synchronization domains?

 

Can anyone point me to documentation or examples of how to make use of the SynchronizationContext class and/or synchronization domains

For example, I'd like to learn how to make use of the exitContext parameter of the Monitor.Wait method and/or make use of my own SynchronizationContext.

 

Thanks,

Ray Manning



Answer this question

Documentation: SynchronizationContext and synchronization domains?

  • BratZeid

    Hi Ray,
    More information on the using the exitContext parameter for Monitor.Wait can be found in the documentation for Monitor.Wait available at http://msdn2.microsoft.com/en-us/library/79fkfcw1.aspx. Please look in the Remarks section on "Notes on Exiting the Context". If you need further details or have specific questions, please post back here.
    Note that the "Context" that Monitor.Wait and friends refer to is not the same as the SynchronizationContext class. "Context" here refers to the fact that the CLR can sub-divide an appdomain into context. Here's a MSDN magazine article that talks more about contexts: http://msdn.microsoft.com/msdnmag/issues/03/03/contextsinnet/

    The SynchronizationContext is a new class that was introduced in the 2.0 release of the .Net Framework. The intent is that providers of synchronization models will derive from this class and override the methods like Send/Post. For example, System.Windows.Forms.WindowsFormsSynchronizationContext
    derives from this class and provides its own implementation for some of the methods.
    Thanks,
    -Arun [MS]
    CLR Team

  • Documentation: SynchronizationContext and synchronization domains?