Export (0) Print
Expand All

DefaultWorkflowSchedulerService Constructor (Int32)

Initializes a new instance of the DefaultWorkflowSchedulerService class by using the specified maximum number of workflow instances that the service can run simultaneously.

Namespace:  System.Workflow.Runtime.Hosting
Assembly:  System.Workflow.Runtime (in System.Workflow.Runtime.dll)

public DefaultWorkflowSchedulerService(
	int maxSimultaneousWorkflows
)

Parameters

maxSimultaneousWorkflows
Type: System.Int32

An integer that determines the maximum number of workflow instances that can be stored in the thread pool queue.

ExceptionCondition
ArgumentOutOfRangeException

maxSimultaneousWorkflows is less than 1.

Setting maxSimultaneousWorkflows to a high value might cause the .NET thread pool to starve. This could cause time-outs when a persistence service tries to complete a persistence transaction because Transaction objects also use the .NET thread pool.

If not specified in a constructor or configuration file, the default value for maxSimultaneousWorkflows is 5 for a single-processor machine, and (int)(5 * Environment.ProcessorCount * .8) for a multiple-processor machine. Note that (int)(5 * Environment.ProcessorCount * .8) is not always the same as (int)(4 * Environment.ProcessorCount), because of the rules of integer arithmetic.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0
Show:
© 2015 Microsoft