Sdílet prostřednictvím


ApplicationQueuingAttribute.MaxListenerThreads Vlastnost

Definice

Získá nebo nastaví počet vláken pro extrahování zpráv z fronty a aktivaci odpovídající součásti.

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

Hodnota vlastnosti

Maximální počet vláken pro zpracování zpráv přicházejících do fronty. Výchozí hodnota je nula.

Příklady

Následující příklad kódu získá a nastaví hodnotu ApplicationQueuing vlastnosti atributu 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.
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)

Poznámky

Platný rozsah pro tuto vlastnost je 0 až 1 000. Výchozí hodnota je nula. Pro nově vytvořenou aplikaci je nastavení odvozeno z algoritmu, který se aktuálně používá k určení výchozího počtu vláken naslouchacího procesu: 16násobek počtu procesorů na serveru.

Další informace najdete v tématu QcListenerMaxThreadsKolekce Aplikací.

Platí pro