Changeset 1033
- Timestamp:
- 12/18/08 16:41:10 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Hive.Client.Core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Client.Core/ClientConsoleService/ClientConsoleCommunicator.cs
r959 r1033 12 12 13 13 public StatusCommons GetStatusInfos() { 14 return ConfigManager.Instance.GetStatusForClientConsole(); 14 lock (Core.Locker) { 15 return ConfigManager.Instance.GetStatusForClientConsole(); 16 } 15 17 } 16 18 -
trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs
r1032 r1033 49 49 public delegate string GetASnapshotDelegate(); 50 50 51 public static Object Locker { get; set; } 52 51 53 Dictionary<long, Executor> engines = new Dictionary<long, Executor>(); 52 54 Dictionary<long, AppDomain> appDomains = new Dictionary<long, AppDomain>(); … … 149 151 150 152 PluginManager.Manager.Initialize(); 151 AppDomain appDomain = 153 AppDomain appDomain = PluginManager.Manager.CreateAndInitAppDomainWithSandbox(e.Result.Job.Id.ToString(), sandboxed, typeof(TestJob)); 152 154 appDomain.UnhandledException += new UnhandledExceptionEventHandler(appDomain_UnhandledException); 153 if (!jobs.ContainsKey(e.Result.Job.Id)) { 154 jobs.Add(e.Result.Job.Id, e.Result.Job); 155 appDomains.Add(e.Result.Job.Id, appDomain); 156 157 Executor engine = (Executor)appDomain.CreateInstanceAndUnwrap(typeof(Executor).Assembly.GetName().Name, typeof(Executor).FullName); 158 engine.JobId = e.Result.Job.Id; 159 engine.Queue = MessageQueue.GetInstance(); 160 engine.Start(e.Result.SerializedJob); 161 engines.Add(e.Result.Job.Id, engine); 162 163 ClientStatusInfo.JobsFetched++; 164 165 Debug.WriteLine("Increment FetchedJobs to:" + ClientStatusInfo.JobsFetched); 155 lock (Locker) { 156 if (!jobs.ContainsKey(e.Result.Job.Id)) { 157 jobs.Add(e.Result.Job.Id, e.Result.Job); 158 appDomains.Add(e.Result.Job.Id, appDomain); 159 160 Executor engine = (Executor)appDomain.CreateInstanceAndUnwrap(typeof(Executor).Assembly.GetName().Name, typeof(Executor).FullName); 161 engine.JobId = e.Result.Job.Id; 162 engine.Queue = MessageQueue.GetInstance(); 163 engine.Start(e.Result.SerializedJob); 164 engines.Add(e.Result.Job.Id, engine); 165 166 ClientStatusInfo.JobsFetched++; 167 168 Debug.WriteLine("Increment FetchedJobs to:" + ClientStatusInfo.JobsFetched); 169 } 166 170 } 167 171 } … … 170 174 void wcfService_SendJobResultCompleted(object sender, SendJobResultCompletedEventArgs e) { 171 175 if (e.Result.Success) { 172 AppDomain.Unload(appDomains[e.Result.Job.Id]); 173 appDomains.Remove(e.Result.Job.Id); 174 engines.Remove(e.Result.Job.Id); 175 jobs.Remove(e.Result.Job.Id); 176 ClientStatusInfo.JobsProcessed++; 176 lock (Locker) { 177 AppDomain.Unload(appDomains[e.Result.Job.Id]); 178 appDomains.Remove(e.Result.Job.Id); 179 engines.Remove(e.Result.Job.Id); 180 jobs.Remove(e.Result.Job.Id); 181 ClientStatusInfo.JobsProcessed++; 182 } 177 183 Debug.WriteLine("ProcessedJobs to:" + ClientStatusInfo.JobsProcessed); 178 184 } else {
Note: See TracChangeset
for help on using the changeset viewer.