ThreadStatistics
This is a helper class for retrieving and caching the number of threads available:
public static class ThreadStatistics
{
// The number of threads available for background tasks, excluding the main thread
public static int BackgroundThreadCount;
// The minimum number of threads in the thread pool
public static int ThreadCount;
}