Nodejs 与运行 libevent 有什么不同?
我很好奇是什么让 NodeJS 拥有了现在的超级并发能力。我实际上并没有经常使用其中任何一个,只是在业余时间玩过。
听起来节点承诺您可以设置数千个连接,即使使用 libevent,您也可以做到这一点,比如说在 C++ 中,不是吗?
I am curious what gives nodeJS the super concurrency that it gets right now. I have not actually used with either of these that much, just played with both in my spare time.
Sounds like the 1000s of connections that node promises that you can set it up with, you can do that even with libevent, say in C++, no?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然可以。事实上,node.js 是使用 libev 实现的,它是一个类似于 libevent 的事件库。我认为与用 C++ 构建自己的事件驱动服务器相比,node.js 的主要优点是它非常易于使用,并且非常容易快速启动和运行服务器,而无需自己编写所有基于事件的详细信息。
Sure you could. In fact, node.js is implemented using libev which is an event library similar to libevent. I think the main advantage of node.js over rolling your own event-driven server in C++ is that it's really easy to use and really easy to get a server up and running quickly without having to write all of the event-based details yourself.