title: Is ConcurrentDictionary.GetOrAdd() guaranteed to invoke valueFactoryMethod only once per key?
body: <p><strong>Problem:</strong> I need to implement object cache. The cache need to be thread-safe and need to populate values on demand(lazy loading). The values are retrieved via web service by Key(slow operation). So I've decided to use <code>ConcurrentDictionary</code> and its <a href="https://msdn.microsoft.com/en-us/library/ee378677(v=vs.110).aspx">GetOrAdd()</a> method that has a value factory method supposing that the operation is atomic and synchronized. Unfortunately I found the following statement in the MSDN article: <a href="https://msdn.microsoft.com/en-us/library/dd997369.aspx">How to: Add and Remove Items from a ConcurrentDictionary</a>:</p>
  
  <blockquote>
    <p>Also, although all methods of ConcurrentDictionary are
    thread-safe, not all methods are atomic, specifically GetOrAdd and
    AddOrUpdate. The user delegate that is passed to these methods is
    invoked outside of the dictionary's internal lock.</p>
  </blockquote>
  
  <p>Well that's unfortunate but still doesn't answer my answer completely.</p>
  
  <p><strong>Question:</strong> Is value factory invoked only once per key? In my specific case: Is it possible that multiple threads that are looking for the same key spawning  multiple request to the web service for the same value?</p>