Example #1
0
 public override void changePriority(WorkerPriorityType priority)
 {
     base.changePriority(priority);
     if (_sourceDetector != null)
     {
         _sourceDetector.ChangePriority(priority);
     }
 }
Example #2
0
 /// <summary>
 /// sets the priority
 /// </summary>
 /// <param name="priority"></param>
 public void setPriority(WorkerPriorityType priority)
 {
     Util.ThreadSafeRun(this.priority, delegate {
         isSettingPriority           = true;
         this.priority.SelectedIndex = (int)priority;
         isSettingPriority           = false;
     });
 }
Example #3
0
 /// <summary>
 /// catches the ChangePriority event from the progresswindow and forward it to the encoder class
 /// </summary>
 /// <param name="priority"></param>
 private void Pw_PriorityChanged(WorkerPriorityType priority)
 {
     try
     {
         currentProcessor.changePriority(priority);
     }
     catch (JobRunException e)
     {
         log.LogValue("Error attempting to change priority", e, ImageType.Error);
     }
 }
Example #4
0
 public void ChangePriority(WorkerPriorityType priority)
 {
     try
     {
         if (analyseThread != null && analyseThread.IsAlive)
         {
             analyseThread.Priority = OSInfo.GetThreadPriority(priority);
         }
     }
     catch (Exception)
     {
         // process could not be running anymore - ignore
     }
 }
Example #5
0
        /// <summary>
        /// changes the priority of the encoding process/thread
        /// </summary>
        /// <param name="priority">the priority to change to</param>
        /// <param name="error">output for any errors that might ocurr during this method</param>
        /// <returns>true if the priority has been changed, false if not</returns>
        public void changePriority(WorkerPriorityType priority)
        {
            if (this.processorThread == null || !processorThread.IsAlive)
            {
                return;
            }

            try
            {
                processorThread.Priority = OSInfo.GetThreadPriority(priority);
            }
            catch (Exception e) // process could not be running anymore
            {
                throw new JobRunException(e);
            }
        }
Example #6
0
        public static void GetJobPriority(Job oJob, out WorkerPriorityType oPriority, out bool lowIOPriority)
        {
            JobType oType = WorkerSettings.GetJobType(oJob);

            foreach (WorkerPriority oPrioritySettings in MainForm.Instance.Settings.WorkerPriority)
            {
                if (oPrioritySettings.JobType.Equals(oType))
                {
                    oPriority     = oPrioritySettings.Priority;
                    lowIOPriority = oPrioritySettings.LowIOPriority;
                    return;
                }
            }
            oPriority     = WorkerPriorityType.IDLE;
            lowIOPriority = true;
        }
Example #7
0
        public virtual void changePriority(WorkerPriorityType priority)
        {
            if (!IsRunning())
            {
                return;
            }

            try
            {
                processThread.Priority = OSInfo.GetThreadPriority(priority);
            }
            catch (Exception e) // process could not be running anymore
            {
                throw new JobRunException(e);
            }
        }
Example #8
0
        public void changePriority(WorkerPriorityType priority)
        {
            if (!isRunning())
            {
                return;
            }

            try
            {
                WorkerPriority.GetJobPriority(job, out WorkerPriorityType oPriority, out bool lowIOPriority);
                OSInfo.SetProcessPriority(proc, priority, lowIOPriority, iMinimumChildProcessCount);
                return;
            }
            catch (Exception e) // process could not be running anymore
            {
                throw new JobRunException(e);
            }
        }
Example #9
0
 public WorkerPriority(JobType _jobType, WorkerPriorityType _priority, bool _lowIOPriority)
 {
     this._jobType       = _jobType;
     this._priority      = _priority;
     this._lowIOPriority = _lowIOPriority;
 }