ParallelEnumerable.WithDegreeOfParallelism(ParallelQuery<TSource>, Int32) ParallelEnumerable.WithDegreeOfParallelism(ParallelQuery<TSource>, Int32) ParallelEnumerable.WithDegreeOfParallelism(ParallelQuery<TSource>, Int32) ParallelEnumerable.WithDegreeOfParallelism(ParallelQuery<TSource>, Int32) Method

Definição

Define o grau de paralelismo a ser usado em uma consulta.Sets the degree of parallelism to use in a query. O grau de paralelismo é o número máximo de tarefas que serão usadas simultaneamente para processar a 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

O tipo dos elementos de source.The type of elements of source.

Parâmetros

source
ParallelQuery<TSource> ParallelQuery<TSource> ParallelQuery<TSource> ParallelQuery<TSource>

Um ParallelQuery no qual definir o limite em graus de paralelismo.A ParallelQuery on which to set the limit on the degrees of parallelism.

degreeOfParallelism
Int32 Int32 Int32 Int32

O grau de paralelismo para a consulta.The degree of parallelism for the query. O valor padrão é Math.Min(ProcessorCount, MAX_SUPPORTED_DOP) em que MAX_SUPPORTED_DOP é 512.The default value is Math.Min(ProcessorCount, MAX_SUPPORTED_DOP) where MAX_SUPPORTED_DOP is 512.

Retornos

ParallelQuery representa a mesma consulta que a origem, com a limitação no grau de paralelismo definido.ParallelQuery representing the same query as source, with the limit on the degrees of parallelism set.

Exceções

source é uma referência nula (Nada no Visual Basic).source is a null reference (Nothing in Visual Basic).

degreeOfParallelism é menor que 1 ou maior que 511.degreeOfParallelism is less than 1 or greater than 511.

WithDegreeOfParallelism é usado várias vezes na consulta.WithDegreeOfParallelism is used multiple times in the query.

Aplica-se a

Veja também