Node.js vs Async/await in .net
Can someone explain/ redirect me, what is the Difference between Node.js's async model(non blocking thread) vs any other language for example c#'s asynchronous way of handling the I/O. This looks to me that both are same model. Kindly suggest.
Both models are very similar. There are two primary differences, one of which is going away soon (for some definition of "soon").
One difference is that Node.js is asynchronously single-threaded, while ASP.NET is asynchronously multi-threaded. This means the Node.js code can make some simplifying assumptions, because all your code always runs on the same exact thread. So when your ASP.NET code
awaits, it could possibly resume on a different thread, and it's up to you to avoid things like thread-local state.
However, this same difference is also a strength for ASP.NET, because it means
async ASP.NET can scale out-of-the-box up to the full capabilities of your sever. If you consider, say, an 8-core machine, then ASP.NET can process (the synchronous portions of) 8 requests simultaneously. If you put Node.js on a souped-up server, then it's common to actually run 8 separate instances of Node.js and add something like nginx or a simple custom load balancer that handles routing requests for that server. This also means that if you want other resources shared server-wide (e.g., cache), then you'll need to move them out-of-proc as well.
await support in C#/VB allow you to write very natural asynchronous code (and more importantly, maintainable asynchronous code).
await. If you want to play with the "coming soon" stuff now, generators were added in V8 3.19, which was rolled into Node.js 0.11.2 (the Unstable branch). Pass
--harmony-generators to explicitly enable the generator support.