Ejemplo n.º 1
0
 public void Setup()
 {
     lock (dictionaryWithLock)
     {
         foreach (var type in Classes.Types)
         {
             dictionary[type]           = new object();
             dictionaryWithLock[type]   = new object();
             concurrentDictionary[type] = new object();
             hashArrayMap.AddIfNotExist(type, new object());
             imMap = imMap.AddOrUpdate(type, new object());
         }
     }
 }
Ejemplo n.º 2
0
        public void ConcurrentHashArrayMap()
        {
            var hashArrayMap = new ConcurrentHashArrayMap <Type, object>(new GrowthHashArrayMapStrategy(64));

            foreach (var type in Classes.Types)
            {
                hashArrayMap.AddIfNotExist(type, Factory);
            }
        }