Exemplo n.º 1
0
        public ILRUCache <SimpleLRUCacheItem, int> MakeRainbowCache_lock(int Capacity)
        {
            var c = new LRUCache_lock <SimpleLRUCacheItem, int, string>(Capacity);

            SimpleLRUCacheTests.AddRainbowItems(c);
            return(c);
        }
Exemplo n.º 2
0
        public void CreateLRUCache_lock()
        {
            var c = new LRUCache_lock <SimpleLRUCacheItem, int, string>();

            Console.WriteLine("Created Empty Cache.");
            Assert.AreEqual(0, c.Count, 0, "Cache size is not zero");
            c.Put(new SimpleLRUCacheItem(1, "Red"));
            Assert.AreEqual(1, c.Count, 0, "Cache size is not one");
            c.Put(new SimpleLRUCacheItem(2, "Blue"));
            Assert.AreEqual(2, c.Count, 0, "Cache size is not two");
            SimpleLRUCacheTests_lockfree.DumpCache(c, "Most Used/ Recently added to Least used/Oldest ");
            Console.WriteLine("lock Test Complete.");
        }
Exemplo n.º 3
0
        public void ManyGets10k()
        {
            var c = new LRUCache_lock <SimpleLRUCacheItem, int, string>(1000);

            ManyGets(c, 10000);
        }
Exemplo n.º 4
0
        public void RemoveTest()
        {
            var c = new LRUCache_lock <SimpleLRUCacheItem, int, string>(10);

            RemoveOneTest(c);
        }
Exemplo n.º 5
0
        public void ExpirationTest1()
        {
            var c = new LRUCache_lock <SimpleLRUCacheItem, int, string>(10);

            ExpirationTest(c);
        }
Exemplo n.º 6
0
        public void ParallelOperation1()
        {
            var c = new LRUCache_lock <SimpleLRUCacheItem, int, string>(1000);

            ParallelOperations(c);
        }