ThreadPool.GetMinThreads メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ThreadPool.GetMinThreads メソッドの意味・解説 

ThreadPool.GetMinThreads メソッド

新し要求応じるためにスレッド プール内で保持されている、アイドル スレッドの数を取得します

名前空間: System.Threading
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Shared Sub GetMinThreads
 ( _
    <OutAttribute> ByRef workerThreads As
 Integer, _
    <OutAttribute> ByRef completionPortThreads As
 Integer _
)
Dim workerThreads As Integer
Dim completionPortThreads As Integer

ThreadPool.GetMinThreads(workerThreads, completionPortThreads)
public static void GetMinThreads
 (
    out int workerThreads,
    out int completionPortThreads
)
public:
static void GetMinThreads (
    [OutAttribute] int% workerThreads, 
    [OutAttribute] int% completionPortThreads
)
public static void GetMinThreads
 (
    /** @attribute OutAttribute() */ /** @ref */ int workerThreads,
 
    /** @attribute OutAttribute() */ /** @ref */ int completionPortThreads
)
JScript では、値型引数参照渡しされません。

パラメータ

workerThreads

スレッド プール内に現在保持されているアイドル状態ワーカー スレッド最小数。

completionPortThreads

スレッド プール内に現在保持されているアイドル状態非同期 I/O スレッド最小数。

解説解説
使用例使用例

アイドル状態ワーカー スレッド最小数を 4 に設定しアイドル状態非同期 I/O 完了スレッド最小数については元の値を保持する例を次に示します

Imports System
Imports System.Threading

Public Class Test

    <MTAThread> _
    Public Shared Sub Main()
        Dim minWorker, minIOC As Integer
        ' Get the current settings.
        ThreadPool.GetMinThreads(minWorker, minIOC)
        ' Change the minimum number of worker threads to four, but
        ' keep the old setting for minimum asynchronous I/O 
        ' completion threads.
        If ThreadPool.SetMinThreads(4, minIOC) Then
            ' The minimum number of threads was set successfully.
        Else
            ' The minimum number of threads was not changed.
        End If
    End Sub
End Class
using System;
using System.Threading;

public class Test
{
    public static void Main()
    {
        int minWorker, minIOC;
        // Get the current settings.
        ThreadPool.GetMinThreads(out minWorker, out minIOC);
        // Change the minimum number of worker threads to four, but
        // keep the old setting for minimum asynchronous I/O 
        // completion threads.
        if (ThreadPool.SetMinThreads(4, minIOC))
        {
            // The minimum number of threads was set successfully.
        }
        else
        {
            // The minimum number of threads was not changed.
        }
    }
}
using namespace System;
using namespace System::Threading;
int main()
{
   int minWorker;
   int minIOC;
   
   // Get the current settings.
   ThreadPool::GetMinThreads( minWorker, minIOC );
   
   // Change the minimum number of worker threads to four, but
   // keep the old setting for minimum asynchronous I/O
   // completion threads.
   if ( ThreadPool::SetMinThreads( 4, minIOC ) )
   {
      
      // The minimum number of threads was set successfully.
   }
   else
   {
      
      // The minimum number of threads was not changed.
   }
}

import System.*;
import System.Threading.*;
import System.Threading.Thread;

public class Test
{
    public static void main(String[]
 args)
    {
        int minWorker = 0;
        int minIOC = 0;

        // Get the current settings.
        ThreadPool.GetMinThreads(minWorker, minIOC);

        // Change the minimum number of worker threads to four, but
        // keep the old setting for minimum asynchronous I/O 
        // completion threads.
        if (ThreadPool.SetMinThreads(4, minIOC)) {
            // The minimum number of threads was set successfully.
        }
        else {
            // The minimum number of threads was not changed.
        }
    } //main
} //Test
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ThreadPool クラス
ThreadPool メンバ
System.Threading 名前空間
SetMinThreads
GetMaxThreads
GetAvailableThreads



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

ThreadPool.GetMinThreads メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ThreadPool.GetMinThreads メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS