Volatile keyword and locking for instance properties
<p>I have some code for the instance property of a controller class that looks like this:</p>

<pre><code>public class Controller
{
    private static volatile Controller _instance;
    private static object syncRoot = new Object();

    private Controller() { }

    public static Controller Instance
    {
        get
        {
            if (_instance == null)
            {
                lock (syncRoot)
                {
                    if (_instance == null)
                        _instance = new Controller();
                }
            }

            return _instance;
        }
    }

    public void Start()
    {

    }
}
</code></pre>

<p>After reading through the <a href="http://msdn.microsoft.com/en-us/library/x13ttww7%28v=vs.71%29.aspx" rel="nofollow">msdn docs on the volatile keyword</a>, I'm not sure if the second null check is redundant or not and whether the better way to write the getter would be something like this:</p>

<pre><code>get
{            
    lock (syncRoot)
    {
        if (_instance == null)
            _instance = new Controller();
    }            

    return _instance;
}
</code></pre>

<p>Which of the two implementations are better for multi-thread performance and DRY'ness (redundancy removal)?</p>
