dotnet / docs

This repository contains .NET Documentation.
https://learn.microsoft.com/dotnet
Creative Commons Attribution 4.0 International
4.28k stars 5.91k forks source link

Setting completionPortThreads with runtimeconfig.json #32822

Open bartosz-jarmuz opened 1 year ago

bartosz-jarmuz commented 1 year ago

Issue description

Hello, The documentation for setting the ThreadPool MinThreads (https://learn.microsoft.com/en-us/dotnet/core/runtime-config/threading) mentions it's equivalent to ThreadPool.SetMinThreads method https://learn.microsoft.com/en-us/dotnet/api/system.threading.threadpool.setminthreads?view=net-7.0

This method has two parameters - int workerThreads, int completionPortThreads.

Is it possible to set the completionPortThreads with the runtime config? If so, how?

Alternatively, if the completionPortThreads setting does not matter in the new implementations of .NET, could the documents be updated with a remark about this parameter?

Target framework


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

gewarren commented 1 year ago

@kouvel Could you help with this question?

kouvel commented 1 year ago

Is it possible to set the completionPortThreads with the runtime config? If so, how?

There hasn't been a config option to set this value. In .NET 7, the value passed to the API is not effective on Windows, as there isn't a separate IO completion thread pool. On Unixes there has never been a separate IO completion thread pool.

Alternatively, if the completionPortThreads setting does not matter in the new implementations of .NET, could the documents be updated with a remark about this parameter?

Yes probably the docs should be updated. In .NET 7 there was a config option to revert to the previous behavior, the config option has already been removed in main for .NET 8.

bartosz-jarmuz commented 1 year ago

Hello @kouvel, Could you provide a bit more details about "the value passed to the API is not effective on Windows, as there isn't a separate IO completion thread pool."