ParallelEnumerable.WithDegreeOfParallelism<TSource>(ParallelQuery<TSource>, Int32) Método

Definición

Establece el grado de paralelismo que se va a emplear en una consulta.Sets the degree of parallelism to use in a query. El grado de paralelismo es el número máximo de tareas ejecutándose de forma simultánea que se utilizará para procesar la consulta.Degree of parallelism is the maximum number of concurrently executing tasks that will be used to process the query.

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

Parámetros de tipo

TSource

Tipo de elementos de source.The type of elements of source.

Parámetros

source
ParallelQuery<TSource>

ParallelQuery en la que se va a establecer el límite de grados de paralelismo.A ParallelQuery on which to set the limit on the degrees of parallelism.

degreeOfParallelism
Int32

Grado de paralelismo de la consulta.The degree of parallelism for the query.

Devoluciones

ParallelQuery<TSource>

ParallelQuery que representa la misma consulta como origen, con el límite de los grados de paralelismo establecidos.ParallelQuery representing the same query as source, with the limit on the degrees of parallelism set.

Excepciones

source es una referencia nula (nada en Visual Basic).source is a null reference (Nothing in Visual Basic).

degreeOfParallelism es menor que 1 o mayor que 512.degreeOfParallelism is less than 1 or greater than 512.

WithDegreeOfParallelism se utiliza varias veces en la consulta.WithDegreeOfParallelism is used multiple times in the query.

Se aplica a