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

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

ThreadPool.SetMinThreads メソッド

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

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

Public Shared Function SetMinThreads
 ( _
    workerThreads As Integer, _
    completionPortThreads As Integer _
) As Boolean
Dim workerThreads As Integer
Dim completionPortThreads As Integer
Dim returnValue As Boolean

returnValue = ThreadPool.SetMinThreads(workerThreads, completionPortThreads)
public static bool SetMinThreads
 (
    int workerThreads,
    int completionPortThreads
)
public:
static bool SetMinThreads (
    int workerThreads, 
    int completionPortThreads
)
public static boolean SetMinThreads (
    int workerThreads, 
    int completionPortThreads
)
public static function SetMinThreads
 (
    workerThreads : int, 
    completionPortThreads : int
) : boolean

パラメータ

workerThreads

スレッド プール内に保持するアイドル状態ワーカー スレッド新し最小数。

completionPortThreads

スレッド プール内に保持するアイドル状態非同期 I/O スレッド新し最小数。

戻り値
変更成功した場合trueそれ以外場合false

解説解説
使用例使用例

アイドル状態ワーカー スレッド最小数を 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 名前空間
GetMinThreads
GetMaxThreads
GetAvailableThreads



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS