ProcessThread.BasePriority 屬性


取得執行緒的基礎優先權 (Base Priority)。Gets the base priority of the thread.

 property int BasePriority { int get(); };
public int BasePriority { get; }
member this.BasePriority : int
Public ReadOnly Property BasePriority As Integer


執行緒的基礎優先權,由作業系統結合處理序的優先權類別和相關執行緒的優先權層級計算所得。The base priority of the thread, which the operating system computes by combining the process priority class with the priority level of the associated thread.


BasePriority是進程執行緒的開始優先順序。The BasePriority is the starting priority for the process thread. 您可以透過系統監視器的優先順序基底計數器來查看基本優先權的相關資訊。You can view information about the base priority through the System Monitor's Priority Base counter.

作業系統會藉由將執行緒的優先權層級範圍與進程的優先權類別結合, 來計算執行緒的基本優先順序。The operating system computes a thread's base priority by combining the thread's priority level range with the process's priority class. 您可以將Process.PriorityClass進程的屬性設定為ProcessPriorityClass Normal列舉中的其中一個值High, 也BelowNormal就是Idle AboveNormal、、、、或RealTimeYou can set the process's Process.PriorityClass property to one of the values in the ProcessPriorityClass enumeration, which are Idle, Normal, High, AboveNormal, BelowNormal, or RealTime. 您可以將執行緒的PriorityLevel屬性設定為系結執行緒基底優先順序的值範圍。You can set the thread's PriorityLevel property to a range of values that bounds the thread's base priority. Win32 會使用四個優先順序類別, 每個類別有七個基本優先權層級。Win32 uses four priority classes with seven base priority levels per class.

執行緒的目前優先順序可能偏離基本優先順序。The thread's current priority might deviate from the base priority. 例如, 當處理常式必須放在其他CurrentPriority人以存取處理器時, 作業系統可以根據經過的時間或其他提升來變更屬性。For example, the operating system can change the CurrentPriority property based on the time elapsed or other boosts when a process must be put ahead of others for access to the processor. 此外, 您可以設定PriorityBoostEnabled屬性, 讓系統在處理常式離開等候狀態時, 暫時提高執行緒的優先順序。In addition, you can set the PriorityBoostEnabled property to cause the system to temporarily boost the priority of a thread whenever the process is taken out of the wait state. 當進程回到等候狀態時, 會重設優先順序。The priority is reset when the process returns to the wait state.