Class OdfParallelScheduler
Provides global scheduling hints for OdfKit internal parallel workloads. 提供 OdfKit 內部平行工作負載的全域調度提示。
public static class OdfParallelScheduler
- Inheritance
-
OdfParallelScheduler
- Inherited Members
Properties
ReservationRatio
Gets or sets the CPU core ratio reserved for the host when OdfKit chooses parallelism automatically. 取得或設定 OdfKit 自動選擇平行度時預留給宿主系統的 CPU 核心比例。
public static double ReservationRatio { get; set; }
Property Value
Remarks
值必須大於或等於 0 且小於 1。當呼叫端明確指定平行度時,不會套用此全域預留比例。
WorkerThreadPriority
Gets or sets the temporary thread priority applied while an internal parallel worker is running. 取得或設定內部平行工作執行期間暫時套用的執行緒優先權。
public static ThreadPriority? WorkerThreadPriority { get; set; }
Property Value
Remarks
設為 null 時使用執行階段預設優先權。OdfKit 只會在單一工作委派執行期間暫時套用此值, 並於委派完成後還原原本優先權,避免污染呼叫端或 ThreadPool 後續工作。
Methods
GetEffectiveConcurrency()
Short overload of GetEffectiveConcurrency that uses default values for all optional parameters and forwards to the full overload. 便利多載:GetEffectiveConcurrency 的所有可選參數使用預設值並轉呼叫最長多載。
public static int GetEffectiveConcurrency()
Returns
GetEffectiveConcurrency(int)
Gets effective concurrency. 依指定的平行度與目前核心預留比例,計算實際可使用的工作平行度。
public static int GetEffectiveConcurrency(int requestedMaxConcurrency)
Parameters
requestedMaxConcurrencyint呼叫端要求的最大平行度;小於 1 時自動依核心數與預留比例計算
Returns
- int
實際平行度,至少為 1