Exemple #1
0
        public SimpleThreadPool(int num)
        {
            int num2 = Environment.ProcessorCount;

            if (num2 < 1)
            {
                num2 = 1;
            }
            if (num2 > 128)
            {
                num2 = 128;
            }
            if (num < 1)
            {
                num = num2;
            }
            if (num < 2)
            {
                num = 2;
            }
            if (num > 128)
            {
                num = 128;
            }
            iCount = num;

            int num3 = 24 + (int)(Math.Log((double)num2) * 32.0);

            MaxCount = iCount + num3;
            StartNewThread();
            ActionQueue.AddAction(new Action(AutoIncrement), 100);
        }
Exemple #2
0
 static CacheManager()
 {
     _arrayCacheTable        = new Dictionary <string, Cache>(BuffMaxFiles);
     _mainLock               = new ReaderWriterLockSlim();
     _nowUsedMemory          = 0;
     _CheckFileChanged       = 0;
     _waitClearChanagedFiles = new List <string>();
     _addingLockTag          = 0;
     string[] array = new string[]
     {
         "txt",
         "htm",
         "html",
         "js",
         "css",
         "xml",
         "c",
         "cs",
         "json",
         "vbs",
         "ppt",
         "pdf",
         "doc",
         "xls",
         "htc",
         "docx",
         "xsl"
     };
     _zipFileExtList = array.ToList();
     ActionQueue.AddAction(new Action(FreeCache), 2500);
 }