Changeset 2125
- Timestamp:
- 07/01/09 20:11:39 (15 years ago)
- 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 54 54 this.maxActiveJobs.Location = new System.Drawing.Point(98, 3); 55 55 this.maxActiveJobs.Maximum = new decimal(new int[] { 56 64,56 200, 57 57 0, 58 58 0, -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/GridExecuter.cs
r2094 r2125 83 83 } 84 84 } 85 // wait until any job is finished86 85 WaitHandle[] whArr = asyncResults.Keys.ToArray(); 87 int readyHandleIndex = Wait Handle.WaitAny(whArr, WaitForFinishedJobsTimeout);86 int readyHandleIndex = WaitAny(whArr, WaitForFinishedJobsTimeout); 88 87 if (readyHandleIndex != WaitHandle.WaitTimeout) { 89 88 WaitHandle readyHandle = whArr[readyHandleIndex]; … … 113 112 } 114 113 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 115 128 public override string[] GetJobs() { 116 129 lock (activeAlgorithms) {
Note: See TracChangeset
for help on using the changeset viewer.