在ASP.NET中,每个HttpRequest是否得到自己的线程?
更新 – 要澄清,我正在特别询问传入的请求。
解决方法
如果您是指使用HttpRequest对象从应用程序发出传出请求,则不会在当前线程中运行HttpRequest。
如果你是指IIS和ASP.NET如何处理每个请求的线程,是的。每个请求都在单独的线程上运行。但是,这个模型比这更复杂一点 – 有worker threads and I/O threads要考虑。在加载下,.NET有时会根据需要移动请求from one thread to another。在处理像ThreadStatic这样的东西时,这很重要。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。