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); }
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; } }