Exemple #1
0
 private void Dispose(bool disposing)
 {
     if (this.disposed)
     {
         return;
     }
     if (disposing && this.scheduler != null)
     {
         this.scheduler.Dispose();
         this.scheduler = (QueuedTaskScheduler <BackgroundInventoryManager.InventoryTask>)null;
     }
     this.disposed = true;
 }
Exemple #2
0
 public BackgroundInventoryManager(int parallelTasksCount)
 {
     this.scheduler = new QueuedTaskScheduler <BackgroundInventoryManager.InventoryTask>(new QueuedTaskScheduler <BackgroundInventoryManager.InventoryTask> .TaskProcessingRoutine(this.DoInventory), parallelTasksCount);
     this.scheduler.TaskProcessingFinished += new EventHandler(this.scheduler_TaskProcessingFinished);
     this.globals = new SnmpGlobalSettings();
     this.globals.set_MaxReplies(SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-SNMP MaxReps", 5));
     this.globals.set_RequestTimeout(SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-SNMP Timeout", 2500));
     this.globals.set_RequestRetries(SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-SNMP Retries", 2));
     this.globals.set_HsrpEnabled((bool)SettingsDAL.GetCurrent <bool>("SWNetPerfMon-Settings-SNMP HSRPEnabled", (M0)1));
     this.inventories = new Dictionary <string, BackgroundInventoryManager.DoInventoryDelegate>((IEqualityComparer <string>)StringComparer.OrdinalIgnoreCase);
     this.inventories.Add("Cpu", new BackgroundInventoryManager.DoInventoryDelegate(this.DoCpuInventory));
     this.inventories.Add("Memory", new BackgroundInventoryManager.DoInventoryDelegate(this.DoMemoryInventory));
 }
 // Token: 0x060003BE RID: 958 RVA: 0x000188DC File Offset: 0x00016ADC
 public QueuedTaskScheduler(QueuedTaskScheduler <TTask> .TaskProcessingRoutine routine, int paralleltasksCount)
 {
     this.isRunning           = false;
     this.processingRoutine   = routine;
     this.processingStartInfo = new STPStartInfo
     {
         MaxWorkerThreads = paralleltasksCount,
         MinWorkerThreads = 0,
         StartSuspended   = true
     };
     this.processingThreadPool    = new SmartThreadPool(this.processingStartInfo);
     this.processingGroup         = this.processingThreadPool.CreateWorkItemsGroup(paralleltasksCount);
     this.processingGroup.OnIdle += new WorkItemsGroupIdleHandler(this.processingGroup_OnIdle);
 }
Exemple #4
0
        public QueuedTaskScheduler(
            QueuedTaskScheduler <TTask> .TaskProcessingRoutine routine,
            int paralleltasksCount)
        {
            this.isRunning         = false;
            this.processingRoutine = routine;
            STPStartInfo stpStartInfo = new STPStartInfo();

            stpStartInfo.set_MaxWorkerThreads(paralleltasksCount);
            stpStartInfo.set_MinWorkerThreads(0);
            ((WIGStartInfo)stpStartInfo).set_StartSuspended(true);
            this.processingStartInfo  = stpStartInfo;
            this.processingThreadPool = new SmartThreadPool(this.processingStartInfo);
            this.processingGroup      = this.processingThreadPool.CreateWorkItemsGroup(paralleltasksCount);
            // ISSUE: method pointer
            this.processingGroup.add_OnIdle(new WorkItemsGroupIdleHandler((object)this, __methodptr(processingGroup_OnIdle)));
        }