开发者

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 co开发者_StackOverflow中文版nfigure 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?


  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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜