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>)

启用查询的并行化,并由负责将输入序列拆分成各个分区的自定义分区程序指明其出处。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. 有关详细信息,请参阅并行 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

参数

返回

作为要绑定到 ParallelEnumerable 扩展方法的 ParallelQuery 的源。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).

注解

@No__t-0 运算符可用于将 ParallelQuery 转换为 ParallelQuery (T)。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>)

启用查询的并行化,并由负责将输入序列拆分成各个分区的自定义分区程序指明其出处。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>

基于输入序列的分区程序。A partitioner over the input sequence.

返回

作为要绑定到 ParallelEnumerable 扩展方法的 ParallelQuery 的 sourceThe source as a ParallelQuery to bind to ParallelEnumerable extension methods.

异常

source 为 null 引用(在 Visual Basic 中为 Nothing)。source is a null reference (Nothing in Visual Basic).

注解

启用排序时将使用源分区程序的 GetOrderedPartitions 方法,而如果未启用排序(默认值),则使用分区程序的 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). 不使用源分区程序的 GetDynamicPartitions 和 GetDynamicOrderedPartitions。The source partitioner's GetDynamicPartitions and GetDynamicOrderedPartitions are not used. 有关详细信息和示例,请参阅用于 PLINQ 和 TPL 的自定义分区程序For 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.

参数

source
IEnumerable<TSource>

要转换为 IEnumerable<T>ParallelQuery<TSource>An IEnumerable<T> to convert to a ParallelQuery<TSource>.

返回

作为要绑定到 ParallelEnumerable 扩展方法的 ParallelQuery<TSource> 的源。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).

另请参阅

适用于