ParallelOptions 類別
定義
public ref class ParallelOptions
public class ParallelOptions
type ParallelOptions = class
Public Class ParallelOptions
- 繼承
-
ParallelOptions
備註
根據預設, 類別上的Parallel方法會嘗試使用所有可用的處理器、不可取消, 而且以預設值TaskScheduler為目標TaskScheduler.Default()。By default, methods on the Parallel class attempt to use all available processors, are non-cancelable, and target the default TaskScheduler (TaskScheduler.Default). ParallelOptions啟用覆寫這些預設值。ParallelOptions enables overriding these defaults.
建構函式
ParallelOptions() |
初始化 ParallelOptions 類別的新執行個體。Initializes a new instance of the ParallelOptions class. |
屬性
CancellationToken |
取得或設定與這個 ParallelOptions 執行個體相關聯的 CancellationToken。Gets or sets the CancellationToken associated with this ParallelOptions instance. |
MaxDegreeOfParallelism |
取得或設定這個 ParallelOptions 執行個體啟用的並行工作數目上限。Gets or sets the maximum number of concurrent tasks enabled by this ParallelOptions instance. |
TaskScheduler |
取得或設定與這個 ParallelOptions 執行個體相關聯的 TaskScheduler。Gets or sets the TaskScheduler associated with this ParallelOptions instance. 將這個屬性設為 null,表示應該使用目前的排程器。Setting this property to null indicates that the current scheduler should be used. |
方法
Equals(Object) |
判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object. (繼承來源 Object) |
GetHashCode() |
作為預設雜湊函數。Serves as the default hash function. (繼承來源 Object) |
GetType() |
取得目前執行個體的 Type。Gets the Type of the current instance. (繼承來源 Object) |
MemberwiseClone() |
建立目前 Object 的淺層複製。Creates a shallow copy of the current Object. (繼承來源 Object) |
ToString() |
傳回代表目前物件的字串。Returns a string that represents the current object. (繼承來源 Object) |
適用於
執行緒安全性
此函式是安全線程, 可同時由多個執行緒用來建立多個實例。The constructor is thread-safe and may be used by multiple threads concurrently to construct multiple instances. 其他公用成員都不是安全線程。None of the other public members are thread-safe.