Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/09/08 16:22:33 (16 years ago)
Author:
gkronber
Message:

bug fixing in DistributedEngine and Grid-Infrastructure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.DistributedEngine/DistributedEngine.cs

    r222 r228  
    8989        CompositeOperation compositeOperation = (CompositeOperation)operation;
    9090        if(compositeOperation.ExecuteInParallel) {
    91           WaitHandle[] waithandles = new WaitHandle[compositeOperation.Operations.Count];
    92           int i = 0;
    93           foreach(AtomicOperation parOperation in compositeOperation.Operations) {
    94             waithandles[i++] = jobManager.BeginExecuteOperation(OperatorGraph, GlobalScope, parOperation);
    95           }
    96           // WaitAll works only with maximally 64 waithandles
    97           if(waithandles.Length <= 64) {
    98             WaitHandle.WaitAll(waithandles);
    99           } else {
    100             for(i = 0; i < waithandles.Length; i++) {
    101               waithandles[i].WaitOne();
     91          try {
     92            WaitHandle[] waithandles = new WaitHandle[compositeOperation.Operations.Count];
     93            int i = 0;
     94            foreach(AtomicOperation parOperation in compositeOperation.Operations) {
     95              waithandles[i++] = jobManager.BeginExecuteOperation(OperatorGraph, GlobalScope, parOperation);
    10296            }
    103           }
    104           if(jobManager.Exception != null) {
     97            // WaitAll works only with maximally 64 waithandles
     98            if(waithandles.Length <= 64) {
     99              WaitHandle.WaitAll(waithandles);
     100            } else {
     101              for(i = 0; i < waithandles.Length; i++) {
     102                waithandles[i].WaitOne();
     103              }
     104            }
     105            if(jobManager.Exception != null) {
     106              myExecutionStack.Push(compositeOperation);
     107              Abort();
     108              ThreadPool.QueueUserWorkItem(delegate(object state) { OnExceptionOccurred(jobManager.Exception); });
     109            }
     110          } catch(Exception e) {
    105111            myExecutionStack.Push(compositeOperation);
    106112            Abort();
Note: See TracChangeset for help on using the changeset viewer.