ParallelEnumerable.AsOrdered ParallelEnumerable.AsOrdered ParallelEnumerable.AsOrdered ParallelEnumerable.AsOrdered Method

Definition

Overloads

AsOrdered(ParallelQuery) AsOrdered(ParallelQuery) AsOrdered(ParallelQuery) AsOrdered(ParallelQuery)

Enables treatment of a data source as if it were ordered, overriding the default of unordered. AsOrdered may only be invoked on non-generic sequences returned by AsParallel, ParallelEnumerable.Range, and ParallelEnumerable.Repeat.

AsOrdered<TSource>(ParallelQuery<TSource>) AsOrdered<TSource>(ParallelQuery<TSource>) AsOrdered<TSource>(ParallelQuery<TSource>) AsOrdered<TSource>(ParallelQuery<TSource>)

Enables treatment of a data source as if it were ordered, overriding the default of unordered. AsOrdered may only be invoked on generic sequences returned by AsParallel, ParallelEnumerable.Range, and ParallelEnumerable.Repeat.

AsOrdered(ParallelQuery) AsOrdered(ParallelQuery) AsOrdered(ParallelQuery) AsOrdered(ParallelQuery)

Enables treatment of a data source as if it were ordered, overriding the default of unordered. AsOrdered may only be invoked on non-generic sequences returned by AsParallel, ParallelEnumerable.Range, and ParallelEnumerable.Repeat.

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

Parameters

Returns

The source sequence which will maintain the original ordering in the subsequent query operators.

Exceptions

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

thrown if source contains no elements

-or-

if AsOrdered is called midway through a query. It is allowed to be called immediately after AsParallel(IEnumerable), Range(Int32, Int32) or Repeat<TResult>(TResult, Int32).

Remarks

A natural tension exists between performance and preserving order in parallel processing. By default, a parallelized query behaves as if the ordering of the results is arbitrary unless AsOrdered is applied or there is an explicit OrderBy operator in the query. For more information, see Order Preservation in PLINQ.

See also

AsOrdered<TSource>(ParallelQuery<TSource>) AsOrdered<TSource>(ParallelQuery<TSource>) AsOrdered<TSource>(ParallelQuery<TSource>) AsOrdered<TSource>(ParallelQuery<TSource>)

Enables treatment of a data source as if it were ordered, overriding the default of unordered. AsOrdered may only be invoked on generic sequences returned by AsParallel, ParallelEnumerable.Range, and ParallelEnumerable.Repeat.

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

Type Parameters

TSource

The type of elements of source.

Parameters

Returns

The source sequence which will maintain the original ordering in the subsequent query operators.

Exceptions

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

Thrown if source contains no elements

-or-

if source is not one of AsParallel, ParallelEnumerable.Range, or ParallelEnumerable.Repeat.

Remarks

A natural tension exists between performance and preserving order in parallel processing. By default, a parallelized query behaves as if the ordering of the results is arbitrary unless AsOrdered is applied or there is an explicit OrderBy operator in the query. For more information, see Order Preservation in PLINQ.

See also

Applies to