I was a bit confused on the concept of locking in some scenarios. Let me explain, suppose I have the following:
private readonly MyClass myObj;
private void Go(object state)
{
// call an instance member of myObj, but does it need to be locked?
myObj.SomeMethod(state);
}
So the question is does myObj need to be locked when calling SomeMethod? It is read-only, however since multiple threads can call the instance method SomeMethod of myObj with varying states will this not cause issues??
Thanks.