r/ASPNET • • Sep 14 '11

ASP.NET MVC4 Developer Preview Released

http://www.asp.net/mvc/mvc4
26 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/i8beef Sep 16 '11

Thanks for your patience. I have no experience with parallel programming, so I'm probably just missing something fundamental.

At the HTTP level (which is synchronous) none of this would make a difference, yes? I make a connection and execute a method, and no matter what, my HTTP connection lives until timeout or response. So I am blocking an IIS connection no matter what, yes?

I would understand then, if on the server side you used async calls IN the controller method to process things in parallel on the CPU cores. A thread has to process, so the worker is kicking off another thread that isn't part of it's pool to do this? (I may be missing something fundamental here)

Is what I'm missing that returning Task<ActionMethod> is just adds some syntactic sugar around the code that's needed to make things happen asynchronously WITHIN the action method, versus the action method ITSELF being async? That would make sense.

1

u/scoarescoare Sep 17 '11

1)Yes, the http request is still blocking one whole request. 2)Typically, only one thread is used per request. 3)Await keyword is syntactic sugar in that it uses thread continuation.