using System.Collections.Concurrent;
using System.Collections.Generic;
static ConcurrentDictionary<string, int> _concurrent = new ConcurrentDictionary<string, int>();
public static void Main()
Thread thread1 = new Thread(new ThreadStart(AddToDict));
Thread thread2 = new Thread(new ThreadStart(AddToDict));
Console.WriteLine("Average: {0}", _concurrent.Values.Average());
for (int i = 0; i < 6000; i++)
_concurrent.TryAdd(i.ToString(), i);