ApplicationQueuingAttribute.MaxListenerThreads 属性
定义
获取或设置用于从队列提取消息并激活相应组件的线程的数目。Gets or sets the number of threads used to extract messages from the queue and activate the corresponding component.
public:
property int MaxListenerThreads { int get(); void set(int value); };
public int MaxListenerThreads { get; set; }
member this.MaxListenerThreads : int with get, set
Public Property MaxListenerThreads As Integer
属性值
用于处理到达队列中的消息的线程的最大数目。The maximum number of threads to use for processing messages arriving in the queue. 默认值为零。The default is zero.
示例
下面的代码示例获取并设置属性的属性的值 ApplicationQueuing MaxListenerThreads 。The following code example gets and sets the value of an ApplicationQueuing attribute's MaxListenerThreads property.
// This example code requires that an ApplicationQueuing attribute be
// applied to the assembly, as shown below:
// [assembly: ApplicationQueuing]
// Get the ApplicationQueuingAttribute applied to the assembly.
ApplicationQueuingAttribute attribute =
(ApplicationQueuingAttribute)Attribute.GetCustomAttribute(
System.Reflection.Assembly.GetExecutingAssembly(),
typeof(ApplicationQueuingAttribute),
false);
// Display the current value of the attribute's MaxListenerThreads
// property.
Console.WriteLine(
"ApplicationQueuingAttribute.MaxListenerThreads: {0}",
attribute.MaxListenerThreads);
// Set the MaxListenerThreads property value of the attribute.
attribute.MaxListenerThreads = 1;
// Display the new value of the attribute's MaxListenerThreads
// property.
Console.WriteLine(
"ApplicationQueuingAttribute.MaxListenerThreads: {0}",
attribute.MaxListenerThreads);
' This example code requires that an ApplicationQueuing attribute be
' applied to the assembly, as shown below:
' [assembly: ApplicationQueuing]
' Get the ApplicationQueuingAttribute applied to the assembly.
Dim attribute As ApplicationQueuingAttribute = CType(attribute.GetCustomAttribute(System.Reflection.Assembly.GetExecutingAssembly(), GetType(ApplicationQueuingAttribute), False), ApplicationQueuingAttribute)
' Display the current value of the attribute's MaxListenerThreads
' property.
MsgBox("ApplicationQueuingAttribute.MaxListenerThreads: " & attribute.MaxListenerThreads)
' Set the MaxListenerThreads property value of the attribute.
attribute.MaxListenerThreads = 1
' Display the new value of the attribute's MaxListenerThreads
' property.
MsgBox("ApplicationQueuingAttribute.MaxListenerThreads: " & attribute.MaxListenerThreads)
注解
此属性的有效范围是0到1000。The valid range for this property is 0 to 1000. 默认值为零。The default is zero. 对于新创建的应用程序,该设置派生自当前用于确定侦听器线程默认数量的算法:服务器中 Cpu 数的16倍。For a newly created application, the setting is derived from the algorithm currently used for determining the default number of listener threads: 16 times the number of CPUs in the server.
有关详细信息,请 QcListenerMaxThreads 参阅 应用程序集合中的。For more information, see QcListenerMaxThreads in Applications collection.