GetOrAdd combines lookup and insertion for a thread-safe cache. It returns the existing value for a key or creates and adds one when the key is missing. section 13.2.1
The delegate overload can execute initialization more than once when threads race. Only one result is stored, and competing callers receive the same published object. Keep initialization repeatable, or account for cleanup when discarded objects have resources. section 13.2.1
Listing 13.8 Thread-safe cache with ConcurrentDictionary.GetOrAdd
var item = dictionary.GetOrAdd(itemId,CreateAndInitializeItem);
Use the delegate overload to replace a separate TryGetValue, construction, and TryAdd sequence with one cache operation. section 13.2.1
