using System.Collections.Concurrent;
namespace Samples.Console
public static void Main(string[] args)
Thread thread1 = new Thread(() => StaticField.StaticFieldTest());
Thread thread2 = new Thread(() => StaticField.StaticFieldTest());
public static readonly ConcurrentDictionary<string, string> _dic = InitDictionary();
public static void StaticFieldTest()
System.Console.WriteLine("Start Running...");
_dic.TryAdd(string.Empty, string.Empty);
_dic.TryAdd(string.Empty, string.Empty);
_dic.TryAdd(string.Empty, string.Empty);
public static ConcurrentDictionary<string, string> InitDictionary()
System.Console.WriteLine("The Dictionary has been initialized now");
return new ConcurrentDictionary<string, string>();