I have a class which doesn't currently need to be thread-safe, but in future we might want to make a thread-safe version. The way I see it, I can either make it thread-safe now by putting locks around the relevant functions, or I can make them virtual now and put locks around them in overrides in a descendent class later on. That is, today I can either do this:
public void DoStuff()
{
lock (this.SyncRoot)
{
// Do stuff...
}
}
Or I can do this:
public virtual void DoStuff()
{
// Do stuff...
}
Which option will get the stuff done faster, today?