Changeset 36
- Timestamp:
- 03/01/08 20:34:08 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.DistributedEngine/DistributedEngine.cs
r35 r36 38 38 private string serverAddress; 39 39 private bool cancelRequested; 40 private CompositeOperation waitingOperations; 40 41 public string ServerAddress { 41 42 get { return serverAddress; } … … 48 49 public override bool Terminated { 49 50 get { 50 return myExecutionStack.Count == 0 && runningEngines.Count == 0 ;51 return myExecutionStack.Count == 0 && runningEngines.Count == 0 && waitingOperations==null; 51 52 } 52 53 } … … 100 101 base.Abort(); 101 102 cancelRequested = false; 103 if(waitingOperations != null && waitingOperations.Operations.Count != 0) { 104 myExecutionStack.Push(waitingOperations); 105 waitingOperations = null; 106 } 102 107 return; 103 108 } … … 117 122 } 118 123 OnOperationExecuted(engineOperations[engineGuid]); 119 if(resultEngine.ExecutionStack.Count != 0) { 120 foreach(IOperation op in resultEngine.ExecutionStack) { 121 myExecutionStack.Push(op); 124 125 if(cancelRequested & resultEngine.ExecutionStack.Count != 0) { 126 if(waitingOperations == null) { 127 waitingOperations = new CompositeOperation(); 128 waitingOperations.ExecuteInParallel = false; 122 129 } 130 CompositeOperation task = new CompositeOperation(); 131 while(resultEngine.ExecutionStack.Count > 0) { 132 AtomicOperation oldOperation = (AtomicOperation)resultEngine.ExecutionStack.Pop(); 133 if(oldOperation.Scope == resultEngine.InitialOperation.Scope) { 134 oldOperation = new AtomicOperation(oldOperation.Operator, oldScope); 135 } 136 task.AddOperation(oldOperation); 137 } 138 waitingOperations.AddOperation(task); 123 139 } 124 140 runningEngines.Remove(engineGuid);
Note: See TracChangeset
for help on using the changeset viewer.