ParallelOptions ParallelOptions ParallelOptions ParallelOptions Class

定義

儲存選項,這些選項設定 Parallel 類別上之方法的作業。Stores options that configure the operation of methods on the Parallel class.

public ref class ParallelOptions
public class ParallelOptions
type ParallelOptions = class
Public Class ParallelOptions
繼承
ParallelOptionsParallelOptionsParallelOptionsParallelOptions

備註

根據預設, 類別上的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() ParallelOptions() ParallelOptions()

初始化 ParallelOptions 類別的新執行個體。Initializes a new instance of the ParallelOptions class.

屬性

CancellationToken CancellationToken CancellationToken CancellationToken

取得或設定與這個 ParallelOptions 執行個體相關聯的 CancellationTokenGets or sets the CancellationToken associated with this ParallelOptions instance.

MaxDegreeOfParallelism MaxDegreeOfParallelism MaxDegreeOfParallelism MaxDegreeOfParallelism

取得或設定這個 ParallelOptions 執行個體啟用的並行工作數目上限。Gets or sets the maximum number of concurrent tasks enabled by this ParallelOptions instance.

TaskScheduler TaskScheduler TaskScheduler TaskScheduler

取得或設定與這個 ParallelOptions 執行個體相關聯的 TaskSchedulerGets 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) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from 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.

另請參閱