难道一个ASP.NET HTTP请求翻译成1主题? [英] Does an ASP.NET HTTP Request Translate to 1 Thread?

查看:95
本文介绍了难道一个ASP.NET HTTP请求翻译成1主题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它是安全的假设,当用户请求通过HTTP一个.aspx页面,那ASP.NET为它创建至少1个线程?

Is it safe to assume that when a user requests an .aspx page via HTTP, that ASP.NET creates at least 1 thread for it?

如果是这样,如何​​长时间持续多久?

If so, how long does it last?

如果1000人进行的HTTP请求到相同的.aspx页面中,有没有涉及线程的一些回收,所以也没有酿出不同的线程1000?

If 1000 people make the HTTP request to the same .aspx page, is there some recycling of threads involved, so it doesn't spawn different 1000 threads?

推荐答案

每个请求被分配从IIS网页池中的线程。这个想法是,这应该是很短的运行中的进程,使得线程可以通过未来另一个请求(页面池大小不庞大,通常,像50)返回到页面池以供使用。所以,如果你有一个长期运行的请求时,它让你的异步调用,以释放线程一些其他的要求是很重要的。那么,在你的长期运行的请求后,您将获得从池中另一个线程,并完成了。

Each request is allocated a thread from the iis page pool. the idea is that this should be a short running process so that thread can be returned to the page pool for use by another request coming (page pool sizes are not huge, usually, like 50). So, if you have a long running request, it's important you make an async call to free the thread for some other request. then, on your long running requests completion, you will get another thread from the pool and finish up.

底线,如果1000人做在同一时间的请求,其中没有完成,50个左右运行,另950将等待。

Bottom line, if 1000 people make requests at the same time and none of them finish, 50 or so will run and the other 950 will wait.

这篇关于难道一个ASP.NET HTTP请求翻译成1主题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆