[英]node.js vs. asp.net async pages
still trying to understnad node.js...仍在尝试了解 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?如果我为每个 i/o 操作应用 asp.net 异步模式,并配置 maxWorkerThreads=1,它(概念上)是否类似于 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? i/o 操作(在任一框架中)是否发生在其自己的线程中,或者是否有一些操作系统功能来获取通知/轻线程?
this SO thread says that node.js still uses threads internally so it is not such a big difference from asp.net. 这个SO 线程说 node.js 仍然在内部使用线程,所以它与 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?
一些答案说是的,但它是一个更好的编程 model 等。问题指的是哪些线程,轻量级 i/o 就像我在 #2 中问的那样?
As for the i/o operations that's implementation specific.至于特定于实现的 i/o 操作。 the linux backend uses libev and the windows backend uses IOCP.
linux 后端使用 libev,windows 后端使用 IOCP。 See this video on async i/o details for windows/linux
有关 windows/linux 的异步 i/o 详细信息,请参阅此视频
node.js only uses threads internally because linux doesn't have an async IO system (like windows does with IOCP). node.js 仅在内部使用线程,因为 linux 没有异步 IO 系统(如 Z0F4137ED15025B5045D603 有 AAIOCP.5558B)C So to make async IO possible you need an internal thread pool.
因此,要使异步 IO 成为可能,您需要一个内部线程池。 See the video.
看视频。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.