Changeset 1815
- Timestamp:
- 05/14/09 17:12:03 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/3.2/EngineBase.cs
r1529 r1815 67 67 } 68 68 69 private ThreadPriority myPriority; 70 /// <summary> 71 /// Gets or sets the priority of the worker thread. 72 /// </summary> 73 public ThreadPriority Priority { 74 get { return myPriority; } 75 set { myPriority = value; } 76 } 77 69 78 /// <summary> 70 79 /// Field of the current instance that represent the execution stack. … … 113 122 myOperatorGraph = new OperatorGraph(); 114 123 myGlobalScope = new Scope("Global"); 124 myPriority = ThreadPriority.Normal; 115 125 myExecutionStack = new Stack<IOperation>(); 116 126 Reset(); … … 183 193 184 194 private void Run(object state) { 195 Thread.CurrentThread.Priority = Priority; 185 196 if (state == null) Run(); 186 197 else RunSteps((int)state); 187 198 myRunning = false; 199 Thread.CurrentThread.Priority = ThreadPriority.Normal; 188 200 OnFinished(); 189 201 } … … 302 314 /// time is saved as string in the node's inner text.</description> 303 315 /// </item> 316 /// <item> 317 /// <term>Priority: </term> 318 /// <description>Saved as a child node with the tag name <c>Priority</c>, where the thread priority 319 /// is saved as string in the node's inner text.</description> 320 /// </item> 304 321 /// </list></remarks> 305 322 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param> … … 323 340 timeNode.InnerText = ExecutionTime.ToString(); 324 341 node.AppendChild(timeNode); 342 XmlNode priorityNode = document.CreateNode(XmlNodeType.Element, "Priority", null); 343 priorityNode.InnerText = Priority.ToString(); 344 node.AppendChild(priorityNode); 325 345 return node; 326 346 } … … 344 364 XmlNode timeNode = node.SelectSingleNode("ExecutionTime"); 345 365 myExecutionTime = TimeSpan.Parse(timeNode.InnerText); 366 XmlNode priorityNode = node.SelectSingleNode("Priority"); 367 if (priorityNode != null) 368 myPriority = (ThreadPriority) Enum.Parse(typeof(ThreadPriority), priorityNode.InnerText); 346 369 } 347 370 #endregion -
trunk/sources/HeuristicLab.Core/3.2/Interfaces/IEngine.cs
r776 r1815 23 23 using System.Collections.Generic; 24 24 using System.Text; 25 using System.Threading; 25 26 26 27 namespace HeuristicLab.Core { … … 44 45 /// </summary> 45 46 TimeSpan ExecutionTime { get; } 47 /// <summary> 48 /// Gets or sets the thread priority of the worker thread. 49 /// </summary> 50 ThreadPriority Priority { get; set; } 46 51 47 52 /// <summary> -
trunk/sources/HeuristicLab.Hive.Engine/3.2/HiveEngine.cs
r1773 r1815 62 62 } 63 63 64 public ThreadPriority Priority { 65 get { return job.Engine.Priority; } 66 set { job.Engine.Priority = value; } 67 } 68 64 69 public bool Running { 65 70 get { return job.Engine.Running; } -
trunk/sources/HeuristicLab.Hive.Engine/3.2/Job.cs
r1761 r1815 42 42 : base() { 43 43 engine = new SequentialEngine.SequentialEngine(); 44 engine.Priority = ThreadPriority.Lowest; 44 45 RegisterEvents(); 45 46 }
Note: See TracChangeset
for help on using the changeset viewer.