ApplicationQueuingAttribute.MaxListenerThreads Eigenschaft

Definition

Ruft die Anzahl der Threads ab, die zum Extrahieren von Meldungen aus der Warteschlange und zum Aktivieren der entsprechenden Komponente verwendet werden, oder legt diese fest.

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

Eigenschaftswert

Die maximale Anzahl von Threads zum Verarbeiten von in der Warteschlange eingehenden Meldungen. Der Standardwert ist 0.

Beispiele

Im folgenden Codebeispiel wird der Wert der Eigenschaft eines ApplicationQueuing Attributs MaxListenerThreads abgerufen und festgelegt.

// 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)

Hinweise

Der gültige Bereich für diese Eigenschaft ist 0 bis 1000. Der Standardwert ist 0. Für eine neu erstellte Anwendung wird die Einstellung von dem Algorithmus abgeleitet, der derzeit zur Bestimmung der Standardanzahl von Listenerthreads verwendet wird: 16-mal so viele CPUs auf dem Server.

Weitere Informationen finden Sie unter QcListenerMaxThreadsAnwendungssammlung.

Gilt für: