Changeset 811
- Timestamp:
- 11/24/08 13:38:55 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs
r808 r811 67 67 68 68 public void Start() { 69 Heartbeat beat = new Heartbeat { Interval = 30000 };69 Heartbeat beat = new Heartbeat { Interval = 5000 }; 70 70 beat.StartHeartbeat(); 71 71 … … 124 124 break; 125 125 case MessageContainer.MessageType.SnapshotReady: 126 //Grabbing of the snapshot will need some time, so let's make this functun async 127 GetASnapshotDelegate ssd = new GetASnapshotDelegate(engines[container.JobId].GetSnapshot); 128 ssd.BeginInvoke(new AsyncCallback(SnapshotReceived), null); 129 //engines[container.JobId].GetSnapshot(); 126 Thread ssr = new Thread(new ParameterizedThreadStart(GetSnapshot)); 127 ssr.Start(container.JobId); 130 128 break; 131 129 132 133 case MessageContainer.MessageType.FetchJob: 130 case MessageContainer.MessageType.FetchJob: 134 131 clientCommunicator.PullJobAsync(Guid.NewGuid()); 135 break; 136 132 break; 137 133 case MessageContainer.MessageType.FinishedJob: 138 engines[container.JobId].GetFinishedJob(); 139 AppDomain.Unload(appDomains[container.JobId]); 140 appDomains.Remove(container.JobId); 141 engines.Remove(container.JobId); 142 Status.CurrentJobs--; 143 Debug.WriteLine("Decrement CurrentJobs to:"+Status.CurrentJobs.ToString()); 144 break; 134 Thread finThread = new Thread(new ParameterizedThreadStart(GetFinishedJob)); 135 finThread.Start(container.JobId); 136 break; 145 137 } 146 138 } 147 139 148 void SnapshotReceived(IAsyncResult res) { 149 AsyncResult ar = (AsyncResult) res; 150 GetASnapshotDelegate gss = (GetASnapshotDelegate) ar.AsyncDelegate; 151 String objectRepr = gss.EndInvoke(res); 140 private void GetFinishedJob(object jobId) { 141 long jId = (long)jobId; 142 String obj = engines[jId].GetFinishedJob(); 143 engines[jId].GetFinishedJob(); 144 AppDomain.Unload(appDomains[jId]); 145 appDomains.Remove(jId); 146 engines.Remove(jId); 147 148 Status.CurrentJobs--; 149 Debug.WriteLine("Decrement CurrentJobs to:" + Status.CurrentJobs.ToString()); 150 } 151 152 private void GetSnapshot(object jobId) { 153 long jId = (long)jobId; 154 String obj = engines[jId].GetSnapshot(); 152 155 } 153 156 -
trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs
r805 r811 14 14 List<ClientInfo> clients; 15 15 LinkedList<long> jobs; 16 int nrOfJobs = 10;16 int nrOfJobs = 3; 17 17 18 18 public ClientCommunicator() { 19 19 jobs = new LinkedList<long>(); 20 for (long i = 1; i < nrOfJobs; i++) {20 for (long i = 0; i < nrOfJobs; i++) { 21 21 jobs.AddFirst(i); 22 22 }
Note: See TracChangeset
for help on using the changeset viewer.