VB.NET并行与分布式编程(5)-线程状态与调整[4]
?2)通过System.Diagnostics.ProcessThread来设置优先级,它能设置比第1种方法更多的优先级
Idle? 指定空闲优先级。 它是所有线程的可能的最低优先级值,与关联的 ProcessPriorityClass 的值无关。?
?Lowest? 指定最低优先级。 这比关联的 ProcessPriorityClass 的普通优先级低两级。?
?BelowNormal? 指定的优先级比关联的 ProcessPriorityClass 的普通优先级低一级。?
?Normal? 指定关联的 ProcessPriorityClass 的普通优先级。?
?AboveNormal? 指定的优先级比关联的 ProcessPriorityClass 的普通优先级高一级。?
?Highest? 指定最高优先级。 这比关联的 ProcessPriorityClass 的普通优先级高两级。?
?TimeCritical? 指定时间关键优先级。 这是所有线程中的最高优先级,与关联的 ProcessPriorityClass 的值无关
?
部分代码
mythread1.Start(myprocess) mythread2.Start(myprocess) mythread3.Start(myprocess) mythread1.Suspend() mythread2.Suspend() mythread3.Suspend() mythread1.Resume() mythread2.Resume() mythread3.Resume()??
?