最大线程数 [英] The maximum number of thread

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

问题描述

在 Delphi 中开发的 32 位和 64 位应用程序中的最大线程数是多少?

What is the maximum number of thread in an application 32-bits and 64-bits developed in Delphi?

我需要知道在 32 位应用程序上同时运行的线程的限制是多少,因为我在做性能分析并且我想让操作系统管理正在等待的线程的执行顺序.

I need to know what is the limit of threads running simultaneously on a 32-bit application, because I'm doing performance analysis and I want to let the OS manage the execution order of the threads that are waiting.

推荐答案

你可能想阅读这个答案:https://stackoverflow.com/a/481919/1560865

You might want to read this answer: https://stackoverflow.com/a/481919/1560865

不过,我在我上面的评论中所写的部分仍然是正确的(但也请注意下面马丁·詹姆斯对此的反对).

Still, what I wrote in my comment above stays partially true (but please also notice Martin James' objection to it below).

请注意 - 一般而言 - 如果您创建的线程数多于处理器内核(或虚拟等效项),您将不会获得任何性能优势.如果你创建太多,你甚至会得到像这样的非常糟糕的结果:thedailywtf.com/Articles/Less-is-More.aspx 你也是完全确定您需要理论上可能的最大线程数吗?

Notice that - generally speaking - if you create way more threads than processor cores (or virtual equivalents), you will not gain any performance advantage. If you create too many, you'll even end up with pretty bad results like these: thedailywtf.com/Articles/Less-is-More.aspx So are you completely sure that you'll need the theoretically possible maximum number of threads?

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

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