Changing an ASP.NET MVC synchronous controller (Controller
) to an asynchronous controller (AsyncController
) seems like a trivial thing to do, but w
I know this is a old question but i struggled to get the answer , so heres my two cents.
Its like saying that if we do not have fever , should i still take a pill. You should use Asynch controller if you see thread starvation on your web server. IIS webserver maintains a pool of threads. So when any request comes in he picks up the thread from thread pool. If at a given moment all the threads from the pool are utilized and request comes in, that request goes in a waiting mode. This situation is termed as "Thread starvation". You can also watch this youtube video where i have demonstrated how MVC thread starvation looks like
http://www.youtube.com/watch?v=wvg13n5V0V0
When you make your controller as Asynch, it utilizes the thread, spawns the operation, and moves that thread back to the thread pool so it be can utilized for other requests coming in to the MVC application. Once the operation finishes he pulls back the thread from thread pool and displays the view.
I was reading this article recently. It think it summarizes what AsyncController are ment for.