<disableCommitThreadStack > 元素<disableCommitThreadStack> Element

指定在线程启动时是否提交完整线程堆栈。Specifies whether the full thread stack is committed when a thread is started.

<configuration><configuration>
<运行时 ><runtime>
<disableCommitThreadStack><disableCommitThreadStack>

语法Syntax

<disableCommitThreadStack enabled="0|1"/>  

特性和元素Attributes and Elements

下列各节描述了特性、子元素和父元素。The following sections describe attributes, child elements, and parent elements.

特性Attributes

特性Attribute 描述Description
enabledenabled 必需的特性。Required attribute.

指定是否禁止在线程启动时提交完整线程堆栈(默认行为)。Specifies whether committing the full thread stack on thread startup (the default behavior) is disabled.

enabled 特性enabled Attribute

Value DescriptionDescription
00 不禁用公共语言运行时的默认行为(即在线程启动时提交完整线程堆栈)。Do not disable the default behavior of the common language runtime, which is to commit the full thread stack when a thread is started.
11 禁用公共语言运行时的默认行为(即在线程启动时提交完整线程堆栈)。Disable the default behavior of the common language runtime, which is to commit the full thread stack when a thread is started.

子元素Child Elements

无。None.

父元素Parent Elements

元素Element 描述Description
configuration 公共语言运行时和 .NET Framework 应用程序所使用的每个配置文件中的根元素。The root element in every configuration file used by the common language runtime and .NET Framework applications.
runtime 包含有关程序集绑定和垃圾回收的信息。Contains information about assembly binding and garbage collection.

备注Remarks

公共语言运行时的默认行为是在线程启动时提交完整线程堆栈。The default behavior of the common language runtime is to commit the full thread stack when a thread is started. 当必须在内存有限的服务器上创建大量线程,并且其中大多数线程都使用非常小的堆栈空间时,如果公共语言运行时在线程启动时不立即提交完整线程堆栈,则服务器可能会表现更好。If a large number of threads must be created on a server that has limited memory, and most of those threads will use very little stack space, the server might perform better if the common language runtime does not commit the full thread stack immediately when a thread is started.

备注

非托管主机可以使用 STARTUP_DISABLE_COMMITTHREADSTACK STARTUP_FLAGS 枚举中的 启动标志实现相同结果。Unmanaged hosts can use the STARTUP_DISABLE_COMMITTHREADSTACK startup flag in the STARTUP_FLAGS enumeration to accomplish the same result.

示例Example

下面的示例演示如何禁用公共语言运行时的默认行为(即在线程启动时提交完整线程堆栈)。The following example shows how to disable the default behavior of the common language runtime, which is to commit the full thread stack on thread startup.

<configuration>  
   <runtime>  
      <disableCommitThreadStack enabled="1" />  
   </runtime>  
</configuration>  

请参阅See also