1

Currently it is possible to set minimum and maximum worker threads via runtimeconfig.json (https://learn.microsoft.com/en-us/dotnet/core/runtime-config/threading).
The docs mention this is equivalent to calling ThreadPool.SetMinThreads() https://learn.microsoft.com/en-us/dotnet/api/system.threading.threadpool.setminthreads?view=net-7.0

There doesn't seem to be a way to set the IOCP threads via the runtime config.

This got me thinking - why is it so, and more importantly - what is the effect of setting the values for IOCP thread in .NET core?

Also, how can I simulate and verify the effect of this setting in a test app?

Based on answer to this question (https://stackoverflow.com/a/28690956/2892378), I have created a test app in which I can observe the effect of setting both min and max threads in .NET Framework, unfortunately, I am not able to create an equivalent sandbox in .NET Core.

Bartosz
  • 4,406
  • 7
  • 41
  • 80
  • While there might be a good reason to adjust the number of worker threads (barely), there is none for io completion. So they omitted the option. If it is important to you then simply call SetMinThreads(), easy peasy. – Hans Passant Dec 02 '22 at 20:18
  • @HansPassant - thanks a lot - but why is there no reason to adjust it? Can I break something if I set the value to something unreasonable? How can I verify it? – Bartosz Dec 02 '22 at 21:01

0 Answers0