-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Open
Description
Today, depending on the number of processors, we create IO completion poller threads. Back then, we did our analysis on older Arm64 machines to come up with the heuristic and they can be different on modern Arm64 machines. We need to revisit them or have some kind of auto-tuning of number of threads creation.
runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEngine.Unix.cs
Lines 52 to 57 in 0e35b8d
| Architecture architecture = RuntimeInformation.ProcessArchitecture; | |
| int coresPerEngine = architecture == Architecture.Arm64 || architecture == Architecture.Arm | |
| ? 8 | |
| : 30; | |
| return Math.Max(1, (int)Math.Round(Environment.ProcessorCount / (double)coresPerEngine)); |
runtime/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.IO.Windows.cs
Lines 41 to 43 in 39b3aac
| int processorsPerPoller = | |
| AppContextConfigHelper.GetInt32Config("System.Threading.ThreadPool.ProcessorsPerIOPollerThread", 12, false); | |
| return (Environment.ProcessorCount - 1) / processorsPerPoller + 1; |
Related: #67180
Reactions are currently unavailable