gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 22:54:02 25 4
gpt4 key购买 nike

在委托(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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com