Getting and Setting Information in the Thread Pool

You can query information on the thread pool by invoking the ThreadPool.GetMaxThreads, ThreadPool.GetMinThreads, and ThreadPool.GetAvailableThreads methods. GetMaxThreads return the maximum number of concurrent threads that are held by the thread pool; GetMinThreads return the number of idle threads that are maintained waiting for the first new task being requested; and GetAvailableThreads returns the number of available threads. Whichever you use, they all return two values: the number of worker threads and the number of completion threads. Worker threads are units of execution, whereas completion threads are asynchronous I/O operations. The following code demonstrates how you get information ...

Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.