ApplicationQueuingAttribute.MaxListenerThreads プロパティ

定義

メッセージをキューから抽出し、対応するコンポーネントをアクティブ化するために使用するスレッドの数を取得または設定します。

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

プロパティ値

キューに到着するメッセージを処理するときに使用する、スレッドの最大数。 既定値は 0 です。

次のコード例では、属性MaxListenerThreadsの プロパティの値をApplicationQueuing取得および設定します。

// 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 です。 既定値は 0 です。 新しく作成されたアプリケーションの場合、この設定は、リスナー スレッドの既定の数 (サーバー内の CPU の数の 16 倍) を決定するために現在使用されているアルゴリズムから派生します。

詳細については、「Applications コレクション」を参照してくださいQcListenerMaxThreads

適用対象