Changeset 27 for trunk/sources/HeuristicLab.Grid/ProcessingEngine.cs
- Timestamp:
- 02/28/08 12:21:16 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Grid/ProcessingEngine.cs
r2 r27 26 26 using HeuristicLab.Core; 27 27 using System.Xml; 28 using System.Threading; 28 29 29 30 namespace HeuristicLab.Grid { 30 public class ProcessingEngine : ThreadParallelEngine.ThreadParallelEngine { 31 31 public class ProcessingEngine : EngineBase { 32 32 private AtomicOperation initialOperation; 33 33 public AtomicOperation InitialOperation { … … 56 56 initialOperation = (AtomicOperation)PersistenceManager.Restore(node.SelectSingleNode("InitialOperation"), restoredObjects); 57 57 } 58 59 protected override void ProcessNextOperation() { 60 IOperation operation = myExecutionStack.Pop(); 61 if(operation is AtomicOperation) { 62 AtomicOperation atomicOperation = (AtomicOperation)operation; 63 IOperation next = null; 64 try { 65 next = atomicOperation.Operator.Execute(atomicOperation.Scope); 66 } catch(Exception ex) { 67 // push operation on stack again 68 myExecutionStack.Push(atomicOperation); 69 Abort(); 70 ThreadPool.QueueUserWorkItem(delegate(object state) { OnExceptionOccurred(ex); }); 71 } 72 if(next != null) 73 myExecutionStack.Push(next); 74 OnOperationExecuted(atomicOperation); 75 if(atomicOperation.Operator.Breakpoint) Abort(); 76 } else if(operation is CompositeOperation) { 77 CompositeOperation compositeOperation = (CompositeOperation)operation; 78 for(int i = compositeOperation.Operations.Count - 1; i >= 0; i--) 79 myExecutionStack.Push(compositeOperation.Operations[i]); 80 } 81 } 58 82 } 59 83 }
Note: See TracChangeset
for help on using the changeset viewer.