Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2125


Ignore:
Timestamp:
07/01/09 20:11:39 (15 years ago)
Author:
gkronber
Message:

Implemented a fix for #681 (GridExecuter should allow more than 64 concurrent jobs).

Location:
trunk/sources/HeuristicLab.CEDMA.Server/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/ExecuterView.Designer.cs

    r2113 r2125  
    5454      this.maxActiveJobs.Location = new System.Drawing.Point(98, 3);
    5555      this.maxActiveJobs.Maximum = new decimal(new int[] {
    56             64,
     56            200,
    5757            0,
    5858            0,
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/GridExecuter.cs

    r2094 r2125  
    8383            }
    8484          }
    85           // wait until any job is finished
    8685          WaitHandle[] whArr = asyncResults.Keys.ToArray();
    87           int readyHandleIndex = WaitHandle.WaitAny(whArr, WaitForFinishedJobsTimeout);
     86          int readyHandleIndex = WaitAny(whArr, WaitForFinishedJobsTimeout);
    8887          if (readyHandleIndex != WaitHandle.WaitTimeout) {
    8988            WaitHandle readyHandle = whArr[readyHandleIndex];
     
    113112    }
    114113
     114        // wait until any job is finished
     115    private int WaitAny(WaitHandle[] wh, TimeSpan WaitForFinishedJobsTimeout) {
     116      if (wh.Length > 64) {
     117        return WaitHandle.WaitAny(wh, WaitForFinishedJobsTimeout);
     118      } else {
     119        for (int i = 0; i < wh.Length; i++) {
     120          if (wh[i].WaitOne(WaitForFinishedJobsTimeout)) {
     121            return i;
     122          }
     123        }
     124        return WaitHandle.WaitTimeout;
     125      }
     126    }
     127
    115128    public override string[] GetJobs() {
    116129      lock (activeAlgorithms) {
Note: See TracChangeset for help on using the changeset viewer.