ParallelEnumerable.AsParallel ParallelEnumerable.AsParallel ParallelEnumerable.AsParallel ParallelEnumerable.AsParallel Method

定義

啟用查詢的平行化作業。Enables parallelization of a query.

多載

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

啟用查詢的平行化作業。Enables parallelization of a query.

AsParallel<TSource>(Partitioner<TSource>) AsParallel<TSource>(Partitioner<TSource>) AsParallel<TSource>(Partitioner<TSource>) AsParallel<TSource>(Partitioner<TSource>)

啟用查詢的平行化作業,此時則指定負責將輸入序列分成多個分割的自訂 Partitioner 處理來源。Enables parallelization of a query, as sourced by a custom partitioner that is responsible for splitting the input sequence into partitions.

AsParallel<TSource>(IEnumerable<TSource>) AsParallel<TSource>(IEnumerable<TSource>) AsParallel<TSource>(IEnumerable<TSource>) AsParallel<TSource>(IEnumerable<TSource>)

啟用查詢的平行化作業。Enables parallelization of a query.

備註

這個方法會將查詢繫結到 PLINQ。This method binds the query to PLINQ. 如需詳細資訊,請參閱 Parallel LINQ (PLINQ)For more information, see Parallel LINQ (PLINQ).

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

啟用查詢的平行化作業。Enables parallelization of a query.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Linq::ParallelQuery ^ AsParallel(System::Collections::IEnumerable ^ source);
public static System.Linq.ParallelQuery AsParallel (this System.Collections.IEnumerable source);
static member AsParallel : System.Collections.IEnumerable -> System.Linq.ParallelQuery
<Extension()>
Public Function AsParallel (source As IEnumerable) As ParallelQuery

參數

傳回

當 ParallelQuery 繫結到 ParallelEnumerable 擴充方法時的來源。The source as a ParallelQuery to bind to ParallelEnumerable extension methods.

例外狀況

source 是 null 參考 (在 Visual Basic 中為 Nothing)。source is a null reference (Nothing in Visual Basic).

備註

Cast運算子可以用來轉換 ParallelQuery(T) ParallelQuery。The Cast operator can be used to convert a ParallelQuery to a ParallelQuery(T).

另請參閱

AsParallel<TSource>(Partitioner<TSource>) AsParallel<TSource>(Partitioner<TSource>) AsParallel<TSource>(Partitioner<TSource>) AsParallel<TSource>(Partitioner<TSource>)

啟用查詢的平行化作業,此時則指定負責將輸入序列分成多個分割的自訂 Partitioner 處理來源。Enables parallelization of a query, as sourced by a custom partitioner that is responsible for splitting the input sequence into partitions.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Linq::ParallelQuery<TSource> ^ AsParallel(System::Collections::Concurrent::Partitioner<TSource> ^ source);
public static System.Linq.ParallelQuery<TSource> AsParallel<TSource> (this System.Collections.Concurrent.Partitioner<TSource> source);
static member AsParallel : System.Collections.Concurrent.Partitioner<'Source> -> System.Linq.ParallelQuery<'Source>
<Extension()>
Public Function AsParallel(Of TSource) (source As Partitioner(Of TSource)) As ParallelQuery(Of TSource)

類型參數

TSource

source 項目的類型。The type of elements of source.

參數

source
Partitioner<TSource> Partitioner<TSource> Partitioner<TSource> Partitioner<TSource>

輸入序列的 Partitioner。A partitioner over the input sequence.

傳回

source當 ParallelQuery 繫結到 ParallelEnumerable 擴充方法。The source as a ParallelQuery to bind to ParallelEnumerable extension methods.

例外狀況

source 是 null 參考 (在 Visual Basic 中為 Nothing)。source is a null reference (Nothing in Visual Basic).

備註

來源的 partitioner GetOrderedPartitions 排序時,方法使用已啟用,而如果不排序,則用 partitioner GetPartitions 啟用 (預設值)。The source partitioner's GetOrderedPartitions method is used when ordering is enabled, whereas the partitioner's GetPartitions is used if ordering is not enabled (the default). 不會使用來源的 partitioner GetDynamicPartitions 和 GetDynamicOrderedPartitions。The source partitioner's GetDynamicPartitions and GetDynamicOrderedPartitions are not used. 如需詳細資訊和範例,請參閱 < PLINQ 和 TPL 的自訂 PartitionerFor more information and examples, see Custom Partitioners for PLINQ and TPL.

另請參閱

AsParallel<TSource>(IEnumerable<TSource>) AsParallel<TSource>(IEnumerable<TSource>) AsParallel<TSource>(IEnumerable<TSource>) AsParallel<TSource>(IEnumerable<TSource>)

啟用查詢的平行化作業。Enables parallelization of a query.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Linq::ParallelQuery<TSource> ^ AsParallel(System::Collections::Generic::IEnumerable<TSource> ^ source);
public static System.Linq.ParallelQuery<TSource> AsParallel<TSource> (this System.Collections.Generic.IEnumerable<TSource> source);
static member AsParallel : seq<'Source> -> System.Linq.ParallelQuery<'Source>
<Extension()>
Public Function AsParallel(Of TSource) (source As IEnumerable(Of TSource)) As ParallelQuery(Of TSource)

類型參數

TSource

source 項目的類型。The type of elements of source.

參數

傳回

做為來源ParallelQuery<TSource>繫結到 ParallelEnumerable 擴充方法。The source as a ParallelQuery<TSource> to bind to ParallelEnumerable extension methods.

例外狀況

source 是 null 參考 (在 Visual Basic 中為 Nothing)。source is a null reference (Nothing in Visual Basic).

另請參閱

適用於