示例#1
0
 private bool CreateWorkers(string typeID, int count)
 {
     for (int i = 0; i < count; i++)
     {
         ComputeWorker thisWorker = ComputeWorker.WorkerFactory(typeID, settings);
         if (thisWorker == null)
         {
             return(false);
         }
         workers.Add(thisWorker);
     }
     return(true);
 }
示例#2
0
 private void CleanupWorkers(List <ComputeWorker> list)
 {
     while (list.Count > 0)
     {
         ComputeWorker cw = list[0];
         if (cw.status == ComputeFarmWorkerProxy.WorkerStatus.Running)
         {
             cw.Kill();
         }
         cw.Shutdown();
         list.Remove(cw);
         cw = null;
     }
 }