Provides a task scheduler that ensures a maximum concurrency level while running on top of the ThreadPool.
Наследование: System.Threading.Tasks.TaskScheduler
Пример #1
0
		public UrlImageStore(string storeName, ProcessImageDelegate processImage)
		{
			StoreName = storeName;
			ProcessImage = processImage;
			
			lcts = new LimitedConcurrencyLevelTaskScheduler (CONCURRENT_THREADS);
            factory = new TaskFactory(lcts);
			
			if (!Directory.Exists(Path.Combine(baseDir, "Library/Caches/Pictures/")))
				Directory.CreateDirectory(Path.Combine(baseDir, "Library/Caches/Pictures/"));
			
			picDir = Path.Combine(baseDir, "Library/Caches/Pictures/" + storeName);			
		}
        public UrlImageStore(string storeName, ProcessImageDelegate processImage)
        {
            this.StoreName    = storeName;
            this.ProcessImage = processImage;

            lcts    = new LimitedConcurrencyLevelTaskScheduler(CONCURRENT_THREADS);
            factory = new TaskFactory(lcts);

            if (!Directory.Exists(Path.Combine(baseDir, "Library/Caches/Pictures/")))
            {
                Directory.CreateDirectory(Path.Combine(baseDir, "Library/Caches/Pictures/"));
            }

            picDir = Path.Combine(baseDir, "Library/Caches/Pictures/" + storeName);
        }