语言

HttpRuntimeSection.MinFreeThreads 属性

定义

获取或设置必须释放的最小线程数,然后才能为此配置范围中的资源请求提供服务。

public:
 property int MinFreeThreads { int get(); void set(int value); };
[System.Configuration.ConfigurationProperty("minFreeThreads", DefaultValue=8)]
[System.Configuration.IntegerValidator(MinValue=0)]
public int MinFreeThreads { get; set; }
[<System.Configuration.ConfigurationProperty("minFreeThreads", DefaultValue=8)>]
[<System.Configuration.IntegerValidator(MinValue=0)>]
member this.MinFreeThreads : int with get, set
Public Property MinFreeThreads As Integer

属性值

在此配置范围的请求之前,公共语言运行时 (CLR) 线程池中的最小可用线程数将得到服务。 默认值为 8。

属性

示例

以下示例演示如何使用该 MinFreeThreads 属性。

// Get the MinFreeThreads property value.
Response.Write("MinFreeThreads: " +
  configSection.MinFreeThreads + "<br>");

// Set the MinFreeThreads property value to 16
configSection.MinFreeThreads = 16;
' Get the MinFreeThreads property value.
Response.Write("MinFreeThreads: " & _
  configSection.MinFreeThreads & "<br>")

' Set the MinFreeThreads property value to 16
configSection.MinFreeThreads = 16

注解

该 MinFreeThreads 属性定义执行请求的最小可用线程数。 如果没有足够的线程可用,请求将保持排队状态,定期检查线程可用性将继续,直到存在所需的线程量。 默认值为 8。

注释

ASP.NET 为需要其他线程来完成处理的请求保留了一定数量的空闲线程。

适用于

另请参阅