在.NET应用程序的最大线程数? [英] Maximum number of threads in a .NET app?

查看:252
本文介绍了在.NET应用程序的最大线程数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是线程,你可以创建一个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)]

这篇关于在.NET应用程序的最大线程数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆