Udostępnij za pośrednictwem


ThreadPool.GetMinThreads Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Retrieves the number of idle threads the thread pool maintains in anticipation of new requests.

Namespace:  System.Threading
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
<SecuritySafeCriticalAttribute> _
Public Shared Sub GetMinThreads ( _
    <OutAttribute> ByRef workerThreads As Integer, _
    <OutAttribute> ByRef completionPortThreads As Integer _
)
[SecuritySafeCriticalAttribute]
public static void GetMinThreads(
    out int workerThreads,
    out int completionPortThreads
)

Parameters

  • workerThreads
    Type: System.Int32%
    The minimum number of idle worker threads currently maintained by the thread pool.
  • completionPortThreads
    Type: System.Int32%
    The minimum number of idle asynchronous I/O threads currently maintained by the thread pool.

Remarks

Idle threads are maintained by the thread pool in order to reduce the time required to satisfy requests for thread pool threads. Separate minimums are maintained for worker threads and asynchronous I/O threads. Idle threads in excess of the minimums are terminated, to save system resources. Maintenance of the idle threads is a background task.

NoteNote:

In Silverlight-based applications, you cannot change the maximum and minimum number of worker threads.

When GetMinThreads returns, the variable specified by workerThreads contains the minimum number of idle worker threads the thread pool maintains, and the variable specified by completionPortThreads contains the minimum number of idle asynchronous I/O threads the thread pool maintains.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.