166 references to ProcessorCount
aspire (1)
Projects\ProjectLocator.cs (1)
70MaxDegreeOfParallelism = Environment.ProcessorCount
aspire-managed (1)
NuGet\Commands\RestoreCommand.cs (1)
197DisableParallel = Environment.ProcessorCount == 1,
crossgen2 (1)
Crossgen2RootCommand.cs (1)
369var parallelism = Math.Min(24, Environment.ProcessorCount);
dotnet (2)
Commands\Test\MTP\MicrosoftTestingPlatformTestCommand.cs (1)
121degreeOfParallelism = Environment.ProcessorCount;
Commands\Test\MTP\MSBuildUtility.cs (1)
285new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount },
dotnet-svcutil-lib (5)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\SynchronizedPool.cs (1)
339return Environment.ProcessorCount;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TransportDefaults.cs (3)
214return 12 * Environment.ProcessorCount; 219return 2 * Environment.ProcessorCount; 235return 12 * Environment.ProcessorCount;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\UdpConstants.cs (1)
41public static readonly long MaxPendingMessagesTotalSize = 1024 * 1024 * Environment.ProcessorCount; // 512 * 2K messages per processor
GenerateDocumentationAndConfigFiles (3)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
90var pool = new ObjectPool<StringTable>(pool => new StringTable(pool), Environment.ProcessorCount * 2);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.LogBlock.cs (1)
17private static readonly ObjectPool<RoslynLogBlock> s_pool = new(() => new RoslynLogBlock(s_pool!), Math.Min(Environment.ProcessorCount * 8, 256));
ilc (1)
ILCompilerRootCommand.cs (1)
400var parallelism = Math.Min(24, Environment.ProcessorCount);
Microsoft.AspNetCore.Components.Server (1)
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequencePool.cs (1)
55: this(Environment.ProcessorCount * 2, ArrayPool<byte>.Create(80 * 1024, 100))
Microsoft.AspNetCore.Razor.Utilities.Shared (1)
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
Microsoft.Build (5)
BackEnd\Components\Caching\ConfigCache.cs (2)
387capacity => new ConcurrentDictionary<int, BuildRequestConfiguration>(Environment.ProcessorCount, capacity)); 392_byMetadata = new ConcurrentDictionary<ConfigurationMetadata, BuildRequestConfiguration>(Environment.ProcessorCount, configurationsById.Count);
BackEnd\Components\Communications\NodeProviderInProc.cs (1)
131concurrencyLevel: Environment.ProcessorCount,
BackEnd\Components\ProjectCache\ProjectCacheService.cs (1)
36private static readonly ParallelOptions s_parallelOptions = new() { MaxDegreeOfParallelism = Environment.ProcessorCount };
src\msbuild\artifacts\.packages\microsoft.codeanalysis.pooledobjects\5.0.0-1.25277.114\contentFiles\cs\netstandard2.0\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
Microsoft.Build.Framework (1)
NativeMethods.cs (1)
194int numberOfCpus = Environment.ProcessorCount;
Microsoft.Build.Tasks.Core (1)
AssemblyDependency\Node\OutOfProcRarNode.cs (1)
23: this(Environment.ProcessorCount)
Microsoft.CodeAnalysis (7)
Collections\CachingFactory.cs (1)
200Environment.ProcessorCount * 2);
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
337private readonly int _workerCount = Environment.ProcessorCount;
InternalUtilities\RoslynParallel.cs (2)
15internal static readonly ParallelOptions DefaultParallelOptions = new ParallelOptions() { MaxDegreeOfParallelism = Environment.ProcessorCount }; 21? new ParallelOptions { CancellationToken = cancellationToken, MaxDegreeOfParallelism = Environment.ProcessorCount }
InternalUtilities\StringTable.cs (1)
90var pool = new ObjectPool<StringTable>(pool => new StringTable(pool), Environment.ProcessorCount * 2);
InternalUtilities\TextKeyedCache.cs (1)
88Environment.ProcessorCount * 4);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
Microsoft.CodeAnalysis.Analyzers (8)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
90var pool = new ObjectPool<StringTable>(pool => new StringTable(pool), Environment.ProcessorCount * 2);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
36/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 54/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 214/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 232/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 374private static int DefaultDegreeOfParallelism => Environment.ProcessorCount;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.LogBlock.cs (1)
17private static readonly ObjectPool<RoslynLogBlock> s_pool = new(() => new RoslynLogBlock(s_pool!), Math.Min(Environment.ProcessorCount * 8, 256));
Microsoft.CodeAnalysis.AnalyzerUtilities (8)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
90var pool = new ObjectPool<StringTable>(pool => new StringTable(pool), Environment.ProcessorCount * 2);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
36/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 54/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 214/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 232/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 374private static int DefaultDegreeOfParallelism => Environment.ProcessorCount;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.LogBlock.cs (1)
17private static readonly ObjectPool<RoslynLogBlock> s_pool = new(() => new RoslynLogBlock(s_pool!), Math.Min(Environment.ProcessorCount * 8, 256));
Microsoft.CodeAnalysis.CodeStyle (8)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
90var pool = new ObjectPool<StringTable>(pool => new StringTable(pool), Environment.ProcessorCount * 2);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
36/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 54/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 214/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 232/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 374private static int DefaultDegreeOfParallelism => Environment.ProcessorCount;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.LogBlock.cs (1)
17private static readonly ObjectPool<RoslynLogBlock> s_pool = new(() => new RoslynLogBlock(s_pool!), Math.Min(Environment.ProcessorCount * 8, 256));
Microsoft.CodeAnalysis.Extensions.Package (1)
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
Microsoft.CodeAnalysis.ResxSourceGenerator (8)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
90var pool = new ObjectPool<StringTable>(pool => new StringTable(pool), Environment.ProcessorCount * 2);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
36/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 54/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 214/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 232/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 374private static int DefaultDegreeOfParallelism => Environment.ProcessorCount;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.LogBlock.cs (1)
17private static readonly ObjectPool<RoslynLogBlock> s_pool = new(() => new RoslynLogBlock(s_pool!), Math.Min(Environment.ProcessorCount * 8, 256));
Microsoft.CodeAnalysis.Workspaces (3)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
90var pool = new ObjectPool<StringTable>(pool => new StringTable(pool), Environment.ProcessorCount * 2);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.LogBlock.cs (1)
17private static readonly ObjectPool<RoslynLogBlock> s_pool = new(() => new RoslynLogBlock(s_pool!), Math.Min(Environment.ProcessorCount * 8, 256));
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
Windows\WindowsSnapshotProvider.cs (1)
127internal static int GetCpuUnits() => Environment.ProcessorCount;
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (2)
Windows\WindowsSnapshotProviderTests.cs (2)
48Assert.Equal(Environment.ProcessorCount, provider.Resources.GuaranteedCpuUnits); 49Assert.Equal(Environment.ProcessorCount, provider.Resources.MaximumCpuUnits);
Microsoft.Extensions.ObjectPool (2)
DefaultObjectPool.cs (1)
30: this(policy, Environment.ProcessorCount * 2)
DefaultObjectPoolProvider.cs (1)
17public int MaximumRetained { get; set; } = Environment.ProcessorCount * 2;
Microsoft.ML.AutoML (1)
AutoMLExperiment\IPerformanceMonitor.cs (1)
125var cpuUsageInTotal = cpuUsedMs / (Environment.ProcessorCount * _checkIntervalInMilliseconds);
Microsoft.ML.Data (5)
Data\DataViewUtils.cs (1)
100int conc = Math.Max(2, Environment.ProcessorCount - 1);
DataLoadSave\Binary\BinaryLoader.cs (3)
783_threads = Math.Max(1, args.Threads ?? (Environment.ProcessorCount / 2)); 849_threads = Math.Max(1, Environment.ProcessorCount / 2); 857_threads = Math.Max(1, Environment.ProcessorCount / 2);
DataLoadSave\Binary\BinarySaver.cs (1)
667Task[] compressionThreads = new Task[Environment.ProcessorCount];
Microsoft.ML.FastTree (3)
FastTree.cs (1)
185InitializeThreads(FastTreeTrainerOptions.NumberOfThreads ?? Environment.ProcessorCount);
GamTrainer.cs (1)
604ThreadTaskManager.Initialize(GamTrainerOptions.NumberOfThreads ?? Environment.ProcessorCount);
SumupPerformanceCommand.cs (1)
99_parallel = args.Parallel ?? Environment.ProcessorCount;
Microsoft.ML.KMeansClustering (1)
KMeansPlusPlusTrainer.cs (1)
278int maxThreads = Environment.ProcessorCount / 2;
Microsoft.ML.Mkl.Components (1)
SymSgdClassificationTrainer.cs (1)
705int numThreads = _options.NumberOfThreads ?? Environment.ProcessorCount;
Microsoft.ML.Recommender (2)
MatrixFactorizationTrainer.cs (2)
366_threads = options.NumberOfThreads ?? Environment.ProcessorCount; 408_threads = args.NumberOfThreads ?? Environment.ProcessorCount;
Microsoft.ML.StandardTrainers (5)
Standard\LogisticRegression\LbfgsPredictorBase.cs (2)
469int numThreads = !UseThreads ? 1 : (NumThreads ?? Environment.ProcessorCount); 570int numThreads = !UseThreads ? 1 : (NumThreads ?? Environment.ProcessorCount);
Standard\SdcaBinary.cs (1)
141=> Math.Min(8, Math.Max(1, Environment.ProcessorCount / 2));
Standard\SdcaRegression.cs (1)
171=> Math.Min(2, Math.Max(1, Environment.ProcessorCount / 2));
Standard\StochasticTrainerBase.cs (1)
48=> Math.Min(8, Math.Max(1, Environment.ProcessorCount / 2));
Microsoft.NET.StringTools (2)
WeakStringCache.Concurrent.cs (2)
23_stringsByHashCode = new ConcurrentDictionary<int, string>(Environment.ProcessorCount, _initialCapacity); 24_weakHandlesByHashCode = new ConcurrentDictionary<int, StringWeakHandle>(Environment.ProcessorCount, _initialCapacity);
Microsoft.TestPlatform.PlatformAbstractions (2)
Interfaces\System\IEnvironment.cs (1)
38/// <inheritdoc cref="System.Environment.ProcessorCount"/>
netcore\System\PlatformEnvironment.cs (1)
63public int ProcessorCount => Environment.ProcessorCount;
NuGet.Build.Tasks (2)
BuildTasksUtility.cs (1)
219DisableParallel = Environment.ProcessorCount == 1 ? true : disableParallel,
RestoreTaskEx.cs (1)
40public bool DisableParallel { get; set; } = Environment.ProcessorCount == 1;
NuGet.Build.Tasks.Console (1)
MSBuildStaticGraphRestore.cs (1)
978Parallel.ForEach(projects, new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount }, project =>
NuGet.CommandLine.XPlat (4)
Commands\Package\Update\PackageUpdateCommandRunner.cs (1)
362MaxDegreeOfParallelism = Environment.ProcessorCount,
Commands\PackageReferenceCommands\ListPackage\ListPackageCommandRunner.cs (2)
430? Environment.ProcessorCount + 1 // Fallback when no package sources are configured 431: (Environment.ProcessorCount / listPackageArgs.PackageSources.Count) + 1;
Utility\AddPackageCommandUtility.cs (1)
33var maxTasks = Environment.ProcessorCount;
NuGet.Commands (4)
RestoreCommand\RequestFactory\DependencyGraphSpecRequestProvider.cs (1)
91MaxDegreeOfParallelism = Environment.ProcessorCount
RestoreCommand\RestoreRunner.cs (1)
230maxTasks = Environment.ProcessorCount;
src\nuget-client\build\Shared\TaskResultCache.cs (2)
46_cache = new(concurrencyLevel: Environment.ProcessorCount, capacity); 47_perTaskLock = new(concurrencyLevel: Environment.ProcessorCount, capacity);
NuGet.DependencyResolver.Core (2)
src\nuget-client\build\Shared\TaskResultCache.cs (2)
46_cache = new(concurrencyLevel: Environment.ProcessorCount, capacity); 47_perTaskLock = new(concurrencyLevel: Environment.ProcessorCount, capacity);
NuGet.PackageManagement (1)
PackageManagementConstants.cs (1)
13public static readonly int DefaultMaxDegreeOfParallelism = Environment.ProcessorCount;
NuGet.Protocol (3)
Plugins\Logging\MachineLogMessage.cs (1)
16_logicalProcessorCount = Environment.ProcessorCount;
src\nuget-client\build\Shared\TaskResultCache.cs (2)
46_cache = new(concurrencyLevel: Environment.ProcessorCount, capacity); 47_perTaskLock = new(concurrencyLevel: Environment.ProcessorCount, capacity);
Roslyn.Diagnostics.Analyzers (8)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
90var pool = new ObjectPool<StringTable>(pool => new StringTable(pool), Environment.ProcessorCount * 2);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
36/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 54/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 214/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 232/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 374private static int DefaultDegreeOfParallelism => Environment.ProcessorCount;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.LogBlock.cs (1)
17private static readonly ObjectPool<RoslynLogBlock> s_pool = new(() => new RoslynLogBlock(s_pool!), Math.Min(Environment.ProcessorCount * 8, 256));
System.Collections.Concurrent (3)
System\Collections\Concurrent\PartitionerStatic.cs (3)
186long rangeSize = (long)(range / (Environment.ProcessorCount * CoreOversubscriptionRate)); 240int rangeSize = (int)(range / (Environment.ProcessorCount * CoreOversubscriptionRate)); 581int fillBufferMultiplier = (Environment.ProcessorCount > 4) ? 4 : 1;
System.Data.Odbc (1)
src\runtime\src\libraries\Common\src\System\Data\ProviderBase\DbConnectionFactory.cs (1)
26private static readonly Task<DbConnectionInternal?>[] s_pendingOpenNonPooled = new Task<DbConnectionInternal?>[Environment.ProcessorCount];
System.Data.OleDb (1)
System\Data\ProviderBase\DbConnectionFactory.cs (1)
26private static readonly Task<DbConnectionInternal?>[] s_pendingOpenNonPooled = new Task<DbConnectionInternal?>[Environment.ProcessorCount];
System.Diagnostics.DiagnosticSource (2)
System\Diagnostics\Metrics\CounterAggregator.cs (1)
21private readonly PaddedDouble[] _deltas = new PaddedDouble[Math.Min(Environment.ProcessorCount, 8)];
System\Diagnostics\Metrics\RuntimeMetrics.cs (1)
145() => (long)Environment.ProcessorCount,
System.Linq.Parallel (1)
System\Linq\Parallel\Scheduling\Scheduling.cs (1)
34internal static readonly int DefaultDegreeOfParallelism = Math.Min(Environment.ProcessorCount, MAX_SUPPORTED_DOP);
System.Net.Sockets (2)
System\Net\Sockets\SocketAsyncEngine.Unix.cs (2)
50return Environment.ProcessorCount; 58return Math.Max(1, (int)Math.Round(Environment.ProcessorCount / (double)coresPerEngine));
System.Private.CoreLib (20)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (2)
508/// <remarks>Defaults to int.MaxValue. Whatever value is returned will end up being clamped to <see cref="Environment.ProcessorCount"/>.</remarks> 514return Math.Min(partitionCount, Environment.ProcessorCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentDictionary.cs (1)
2054private static int DefaultConcurrencyLevel => Environment.ProcessorCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\RuntimeEventSource.cs (1)
113ProcessorCount(Environment.ProcessorCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\RuntimeEventSourceHelper.Unix.cs (1)
11Interop.Sys.GetCpuUtilization(ref s_cpuInfo) / Environment.ProcessorCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Environment.cs (1)
41internal static bool IsSingleProcessor => RuntimeFeature.IsMultithreadingSupported ? ProcessorCount == 1 : true;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs (4)
289private static readonly PaddedReference[] s_perCoreCache = new PaddedReference[Environment.ProcessorCount]; 358Debug.Assert(s_perCoreCache.Length == Environment.ProcessorCount, $"{s_perCoreCache.Length} != {Environment.ProcessorCount}"); 359int i = (int)((uint)Thread.GetCurrentProcessorId() % (uint)Environment.ProcessorCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelSpinWaiter.cs (1)
23int processorCount = Environment.ProcessorCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.Blocking.cs (1)
320int processorCount = Environment.ProcessorCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.cs (1)
137_minThreads = HasForcedMinThreads ? ForcedMinWorkerThreads : (short)Environment.ProcessorCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.Unix.cs (1)
18Interop.Sys.GetCpuUtilization(ref _cpuInfo) / Environment.ProcessorCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ReaderWriterLockSlim.cs (1)
1229if ((spinCount < 5) && (Environment.ProcessorCount > 1))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\SpinLock.cs (1)
351if (turn > Environment.ProcessorCount)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (1)
64private static int DefaultMaxConcurrencyLevel => Environment.ProcessorCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (2)
420Environment.ProcessorCount <= 32 ? 0 : 421(Environment.ProcessorCount + (ProcessorsPerAssignableWorkItemQueue - 1)) / ProcessorsPerAssignableWorkItemQueue;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (1)
51var queues = new TimerQueue[Environment.ProcessorCount];
System.Reflection.Metadata (1)
System\Reflection\Internal\Utilities\ObjectPool`1.cs (1)
42: this(factory, Environment.ProcessorCount * 2)
System.Runtime.Caching (1)
System\Runtime\Caching\MemoryCache.cs (1)
359_storeCount = Environment.ProcessorCount;
System.ServiceModel.Primitives (1)
Internals\System\Runtime\SynchronizedPool.cs (1)
340return Environment.ProcessorCount;
System.Threading (1)
System\Threading\ReaderWriterLock.cs (1)
30private static readonly int DefaultSpinCount = Environment.ProcessorCount != 1 ? 500 : 0;
System.Threading.Tasks.Parallel (10)
System\Threading\Tasks\Parallel.cs (1)
945Environment.ProcessorCount :
System\Threading\Tasks\Parallel.ForEachAsync.cs (8)
19/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 37/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 55/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 197/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 213/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 352/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 368/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 502private static int DefaultDegreeOfParallelism => Environment.ProcessorCount;
System\Threading\Tasks\TaskReplicator.cs (1)
166return 100 + Random.Shared.Next(0, 50 * Environment.ProcessorCount);
System.Transactions.Local (1)
System\Transactions\DtcProxyShim\DtcProxyShimFactory.cs (1)
38private static readonly int s_maxCachedInterfaces = Environment.ProcessorCount * 2;
VBCSCompiler (1)
src\roslyn\src\Compilers\Server\VBCSCompiler\NamedPipeClientConnectionHost.cs (1)
69var listenCount = Math.Min(4, Environment.ProcessorCount);
vstest.console (1)
CommandLine\Executor.cs (1)
85var additionalThreadsCount = Environment.ProcessorCount * 4;
vstest.console.arm64 (1)
src\vstest\src\vstest.console\CommandLine\Executor.cs (1)
85var additionalThreadsCount = Environment.ProcessorCount * 4;