在.NET应用程序的最大线程数?线程、应用程序、最大、NET

2023-09-02 20:40:49 作者:负我之人无可为人

什么是线程,你可以创建一个C#应用程序的最大数量?而当你达到此限制会发生什么?是一个例外某种抛出?

What is the maximum number of threads you can create in a C# application? And what happens when you reach this limit? Is an exception of some kind thrown?

推荐答案

有没有内在的限制。线程的最大数量由物理资源可用的量来确定。看到雷蒙德陈本文章细节。

There is no inherent limit. The maximum number of threads is determined by the amount of physical resources available. See this article by Raymond Chen for specifics.

如果你要问什么线程的最大数量是,你可能做错了什么。

If you need to ask what the maximum number of threads is, you are probably doing something wrong.

[更新:只是出于兴趣:.NET线程池默认的线程数:

[Update: Just out of interest: .NET Thread Pool default numbers of threads:

在1023的框架4.0(32位环境) 在框架32768 4.0(64位环境) 250每个核心的框架3.5 25%的核心框架2.0

(这些数字可根据硬件和操作系统而变化)]

(These numbers may vary depending upon the hardware and OS)]

 
精彩推荐
图片推荐