I was recently in an Interview and the tech guy asked me about how to make teh app thread safe.
Well, after explaining the lock() correctly, he said it is not a good idea to have the object as static.
private static readonly object _syncLock = new object();
He claimed the reason is that static makes that object slower for threads to lock than if it was non static. ???
EDIT: Nonetheless I am still not sure, what is the difference between
private static readonly object _syncLock = new object();
public static readonly object _syncLock = new object();
private readonly object _syncLock = new object();
Thanks kave