Udostępnij za pośrednictwem


ThreadPool.GetMaxThreads Method

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

Retrieves the number of requests to the thread pool that can be active concurrently. All requests above that number remain queued until thread pool threads become available.

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

Syntax

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

Parameters

  • workerThreads
    Type: System.Int32%
    The maximum number of worker threads in the thread pool.
  • completionPortThreads
    Type: System.Int32%
    The maximum number of asynchronous I/O threads in the thread pool.

Remarks

When GetMaxThreads returns, the variable specified by workerThreads contains the maximum number of worker threads allowed in the thread pool, and the variable specified by completionPortThreads contains the maximum number of asynchronous I/O threads allowed in the thread pool.

NoteNote:

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

You can queue as many thread pool requests as system memory allows. If there are more requests than thread pool threads, the additional requests remain queued until thread pool threads become available.

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.