コード例 #1
0
ファイル: Processor.cs プロジェクト: Liano/intelife
        public bool Kill(ProcessEx process)
        {
            if (process == null)
            throw new ArgumentNullException("process can not be null");

              foreach (var core in this._cores)
              {
            if (core.Process == process)
            {
              core.Kill();
              return true;
            }
              }

              return false;
        }
コード例 #2
0
ファイル: Core.cs プロジェクト: Liano/intelife
        public void Run(ProcessEx process, ProcessPriorityClass priority)
        {
            if (this.Status.InUse)
            throw new InvalidOperationException("Current core is running another process");

              if (process == null)
            throw new ArgumentNullException("Process can not be null");

              this.Process = process;
              this.Process.ExecutingCore = this;

              //bind event
              this.Process.Exited += Process_Exited;

              this.Process.Start();
              this.Process.Status = ProcessExecutionStatus.Running;
              this.Process.PriorityClass = priority;
              this.Status.InUse = true;

              //TODO set affinity
              this.Process.ProcessorAffinity = (IntPtr) (int) Math.Pow(2, this.Status.Index);
        }
コード例 #3
0
ファイル: ProcessManager.cs プロジェクト: Liano/intelife
 /// <summary>
 /// Queues the process.
 /// </summary>
 /// <param name="process">The process to enqueue.</param>
 /// <param name="prc">process priority.</param>
 public void QueueProcess(ProcessEx process, ProcessPriorityClass prc)
 {
     lock (_queueLock)
       {
     this._processQueue.Enqueue(new KeyValuePair<ProcessEx, ProcessPriorityClass>(process, prc));
     process.Status = ProcessExecutionStatus.Queued;
       }
 }
コード例 #4
0
ファイル: ProcessManager.cs プロジェクト: Liano/intelife
 private void Processor_SlotFreed(int freeSlots, ProcessEx finishedProcess)
 {
     this.LaunchQueue();
 }
コード例 #5
0
ファイル: ProcessManager.cs プロジェクト: Liano/intelife
        public void QueueProcess(ProcessEx process)
        {
            if (process == null)
            throw new ArgumentNullException("Process can not be null");

              this.QueueProcess(process, ProcessPriorityClass.Normal);
        }
コード例 #6
0
ファイル: Processor.cs プロジェクト: Liano/intelife
        public void Run(ProcessEx process, ProcessPriorityClass prc)
        {
            if (process == null)
            throw new ArgumentNullException("process can not be null");

              var core = this.GetFirstFreeCore();
              core.Run(process, prc);
        }