Monday, May 24, 2010

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe

This looks quite confusing but that means that all the static/shared functions of this type are using synchronization mechanism inbuilt(with lock or monitor) to update any static data so that threads simultaneously accessing that methods may not corrupt your data and as a developer you don't need to be worry of synchronizing it.
Whilst in the case of any instance variable of that type/class you have to write your own synchronization mechanism to prevent multiple parallel threads modifying the data.

Please go through following articles to know how internally ASP.NET synchronize the objects using sync blocks.

No comments:

Post a Comment