HttpApplication 如何创建和管理线程?
ASP.NET 中的 HttpApplication 如何创建和管理线程?
什么决定 HttpContext 是打开新线程还是使用现有线程?如何控制这种情况?
我会很高兴得到可靠的解释或有关此信息的足够资源的链接。
How are threads created and managed by the HttpApplication in ASP.NET?
What determines if an HttpContext opens a new thread or uses an existing thread? How can this be controlled?
I will be happy with either a solid explanation or a link to a sufficient resource on this information.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它们是从线程池中提取的。它们不是根据每个请求创建的。
永远不会创建新线程。它们从池中提取,并在请求得到服务后返回池中。
这是 ASP.NET 做得很好的事情,不是您想要控制的事情,但如果您真的坚持这里有一篇文章,其中解释了如何在 ASP.NET 中使用 STA 线程而不是 MTA 线程。
They are drawn from a thread pool. They are not created at each request.
New threads are never created. They are drawn from the pool and returned to it once the request has been serviced.
This is something that ASP.NET does very well and not something you want to control but you if you really insist on here's an article which explains how you could use STA threads instead of MTA threads in ASP.NET.
这是来自 Thomas Marquardt 的精彩帖子( Microsoft ASP.Net 开发团队的成员,实际上致力于该领域)研究 IIS6 和 IIS6 中的 ASP.NET 线程使用。 IIS7:
http://blogs.msdn.com/b/tmarq/archive/2007/07/21/asp-net-thread-usage-on-iis-7-0-and-6 -0.aspx
Here is an excellent post from Thomas Marquardt (a member of the Microsoft ASP.Net dev team who actually works on this very area) on ASP.NET thread use in IIS6 & IIS7:
http://blogs.msdn.com/b/tmarq/archive/2007/07/21/asp-net-thread-usage-on-iis-7-0-and-6-0.aspx