开发者

ASP.Net AJAX and ThreadPool

Do ASP.Net based AJAX requests use the same ThreadPool that ASP.Net requests use?

ASP.Net asynchronous programming uses a different thread, returning the thread used for processing ASP.Net requests to the pool.

I want to implement a long running DB search operation.

I am thinking about using an AJAX webmethod.

But here I have a doubt: Do I need to implement this sear开发者_Python百科ch operation in a webmethod using the asynchronous paradigm?

I will only take an asynchronous approach if AJAX requests also use the ASP.Net ThreadPool.

Please throw some light on this.


I think this article might be of some use to you.

Edit:

I've just read this article and have realised what you're asking.

ASP.Net request threads can be released back into the threadpool while an asychronous task is being carried out. You want to know if AJAX/async-postbacks do this as well.

I don't see why they wouldn't. After all, they're not that special from the server's point of view - it's just that instead of rendering the whole page in the response only a part of the page is rendered.

You could probably test this easily enough - set up a page that triggers an slow asynchronous task in an async-postback. Monitor the number of available threads in the threadpool and see if it goes down while the asynchronous task is running. Make sure you test it in a synchronous postback too, as a control.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜