Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node.js vs. asp.net async pages

still trying to understnad node.js...

  1. If I apply the asp.net async pattern for every i/o operation, and configure maxWorkerThreads=1, is it (conceptually) similar to node.js?

  2. Does an i/o operation (in either framework) takes place in its own thread or is there some OS functionality to get notifications / light thread?

  3. this SO thread says that node.js still uses threads internally so it is not such a big difference from asp.net. Some answers say that yes, but it is a better programming model etc. Which threads does the question refers to, lightweight i/o like the ones I asked on in #2?

like image 545
Yaron Naveh Avatar asked Aug 13 '11 12:08

Yaron Naveh


People also ask

Is .NET faster than NodeJS?

NET Core has an easier time working with CPU-intensive tasks and rendering static pages since the in-built IIS server kernel caching makes this process very straightforward. Therefore, . NET core vs node. js performance offers different advantages for various projects.

Is NodeJS really asynchronous?

NodeJS is an asynchronous event-driven JavaScript runtime environment designed to build scalable network applications. Asynchronous here refers to all those functions in JavaScript that are processed in the background without blocking any other request.

Is ASP NET core better than NodeJS?

Besides this, when it comes to maintaining large applications, it is easier to do so with ASP.Net Core in comparison to Node. js. It also helps in creating self-sufficient, autonomous, and microservice applications.

Is C# better than NodeJS?

While ASP.NET uses C# as its primary language, Node. js is based on JavaScript. There's no denying that by offering a strict type system and compile-time error checks, C# is more potent than JavaScript, which relies on Facebook's Flow static type checker or Microsoft TypeScript.


1 Answers

  1. See this similar question

  2. As for the i/o operations that's implementation specific. the linux backend uses libev and the windows backend uses IOCP. See this video on async i/o details for windows/linux

  3. node.js only uses threads internally because linux doesn't have an async IO system (like windows does with IOCP). So to make async IO possible you need an internal thread pool. See the video.

like image 69
Raynos Avatar answered Nov 11 '22 10:11

Raynos