still trying to understnad node.js...
If I apply the asp.net async pattern for every i/o operation, and configure maxWorkerThreads=1, is it (conceptually) similar to node.js?
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?
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?
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.
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.
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.
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.
See this similar question
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With