Synchronized Keyword in C#


synchronized” keyword ensures that:

For Instance Methods– the method can be executed in a single thread on the instance, i.e. different instances are not synchronized. This is equivalent to lock(this).

For Static Methods – the method can be executed in a single thread. This is equivalent to  lock(typeof(TypeName)).



(9)

Leave a Reply

Your email address will not be published. Required fields are marked *