ParallelEnumerable.AsParallel ParallelEnumerable.AsParallel ParallelEnumerable.AsParallel Method

Definition

Enables parallelization of a query.

Overloads

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

Enables parallelization of a query.

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

Enables parallelization of a query.

Remarks

This method binds the query to PLINQ. For more information, see Parallel LINQ (PLINQ).

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);
<Extension()>
Public Function AsParallel (source As IEnumerable) As ParallelQuery
Parameters
Returns

The source as a ParallelQuery to bind to ParallelEnumerable extension methods.

Exceptions

source is a null reference (Nothing in Visual Basic).

Remarks

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

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);
<Extension()>
Public Function AsParallel(Of TSource) (source As Partitioner(Of TSource)) As ParallelQuery(Of TSource)
Type Parameters
TSource

The type of elements of source.

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

A partitioner over the input sequence.

Returns

The source as a ParallelQuery to bind to ParallelEnumerable extension methods.

Exceptions

source is a null reference (Nothing in Visual Basic).

Remarks

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). The source partitioner's GetDynamicPartitions and GetDynamicOrderedPartitions are not used. For more information and examples, see Custom Partitioners for PLINQ and TPL.

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);
<Extension()>
Public Function AsParallel(Of TSource) (source As IEnumerable(Of TSource)) As ParallelQuery(Of TSource)
Type Parameters
TSource

The type of elements of source.

Parameters
source
IEnumerable<TSource>

An IEnumerable<T> to convert to a ParallelQuery<TSource>.

Returns

The source as a ParallelQuery<TSource> to bind to ParallelEnumerable extension methods.

Exceptions

source is a null reference (Nothing in Visual Basic).

Applies to