Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想设置最小线程数。我知道我需要的workerThreads 的数量,但是关于completionPortThreads 它的大小应该是多少(默认情况下它等于处理器的数量)。我可以将其设置为 0 还是有风险?什么时候使用?
如果您愿意,可以将最小线程数设置为 0。这意味着操作系统必须在需要时启动新线程,并在不需要时再次停止它们,并且可能会导致并发运行的任务减少,这两者都会对性能产生影响。
您不能将最大数量设置为小于处理器数量。