c# - 在 ASP.NET 中使用委托(delegate)来处理异步操作

标签 c# asp.net multithreading delegates

在委托(delegate)上调用 BeginInvoke 时,操作在单独的线程上执行。如果在 ASP.NET 中调用它是否使用 CLR 工作线程?还是使用 IIS 工作线程?

如果是后者,那么我将需要采用异步 ASP.NET 模式来确保操作在 CLR 工作线程上执行。但如果操作在 BeginInvoke 时结束,我宁愿不这样做。

最佳答案

它使用 CLR 工作线程。

here 中所述

To begin with, ASP.NET uses the process-wide CLR thread pool to service requests (for more background on the CLR thread pool, see the .NET column in this issue).

编辑:

另一个资源是 this blog

Unfortunately, the thread used by BeginInvoke is actually taken from the same worker thread pool that is used by ASP.Net to handle Page Requests

关于c# - 在 ASP.NET 中使用委托(delegate)来处理异步操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8153370/

相关文章:

c# - 主机不允许连接到此MySQL服务器错误,但我没有使用MySQL

java - 多个线程使用数据库 DAO 类方法获取的相同值

c# - MVC3中使用Get方法提交表单?

c# - ASP.NET:隐藏 CheckBoxList 控件中的 CheckBox 项

c# - 测试以查看图像是否存在于 C# 中

c# - System.Net.Mail.SmtpException : The operation has timed out. 错误在asp.net发送邮件代码使用godaddy托管

c++ - MCS锁实现的问题

c - 多线程和读取文件

c# - asp.net webform 菜单控件如何缩进包裹的元素?

c# - 最大声级是多少