Пример #1
0
        public MemoryCacheContainer(MemoryCache owner, int id, MemoryCachePerformanceCounters perfCounters)
        {
            if (owner == null)
            {
                throw new ArgumentNullException("owner");
            }

            this.owner        = owner;
            this.ID           = id;
            this.perfCounters = perfCounters;
            cache             = new SortedDictionary <string, MemoryCacheEntry> ();
            lru = new MemoryCacheLRU(this, DEFAULT_LRU_LOWER_BOUND);
        }
Пример #2
0
        void CommonInit(string name, NameValueCollection config = null)
        {
            this.defaultCaps = DefaultCacheCapabilities.InMemoryProvider |
                               DefaultCacheCapabilities.CacheEntryChangeMonitors |
                               DefaultCacheCapabilities.AbsoluteExpirations |
                               DefaultCacheCapabilities.SlidingExpirations |
                               DefaultCacheCapabilities.CacheEntryRemovedCallback |
                               DefaultCacheCapabilities.CacheEntryUpdateCallback;

            GetValuesFromConfig(name, config);
            containers   = new MemoryCacheContainer [numCPUs];
            perfCounters = new MemoryCachePerformanceCounters(name.ToLowerInvariant(), noPerformanceCounters);
        }