Node.js 与 asp.net 异步页面
仍在尝试理解node.js...
如果我对每个i/o操作应用asp.net异步模式,并配置maxWorkerThreads=1,它(概念上)是否类似于node.js?
I/O 操作(在任一框架中)是否在其自己的线程中进行,或者是否有某些操作系统功能来获取通知/轻型线程?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看这个类似的问题
至于特定于实现的 i/o 操作。 Linux后端使用libev,Windows后端使用IOCP。 观看有关异步 I/O 详细信息的视频windows/linux
node.js 仅在内部使用线程,因为 linux 没有异步 IO 系统(就像 windows 那样有 IOCP)。因此,为了使异步 IO 成为可能,您需要一个内部线程池。看视频。
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.