libev与libevent区别
摘自stackflow的回答,主要从架构上说明了二者的区别:
As for design philosophy, libev was created to improve on some of the architectural decisions in libevent, for example, global variable usage made it hard to use libevent safely in multithreaded environments, watcher structures are big because they combine I/O, time and signal handlers in one, the extra components such as the http and dns servers suffered from bad implementation quality and resultant security issues, and timers were inexact and didn't cope well with time jumps.
Libev tried to improve each of these, by not using global variables but using a loop context for all functions, by using small watchers for each event type (an I/O watcher uses 56 bytes on x86_64 compared to 136 for libevent), allowing extra event types such as timers based on wallclock vs. monotonic time, inter-thread interruptions, prepare and check watchers to embed other event loops or to be embedded and so on.
The extra component problem is "solved" by not having them at all, so libev can be small and efficient, but you also need to look elsewhere for an http library, because libev simply doesn't have one (for example, there is a very related library called libeio that does asynchronous I/O, which can be used independently or together with libev, so you can mix and match).
So in short, libev tries to do one thing only (POSIX event library), and this in the most efficient way possible. Libevent tries to give you the full solution (event lib, non-blocking I/O library, http server, DNS client).
Or, even shorter, libev tries to follow the UNIX toolbox philosophy of doing one thing only, as good as possible.
Note that this is the design philosophy, which I can state with authority because I designed libev. Whether these design goals have actually been reached, or whether the philosophy is based on sound principles, is up to you to judge.
这是libev作者亲自解释。大家膜拜吧,呵呵!
libev与libevent区别的更多相关文章
- [译]libev和libevent的设计差异
本文译自what's the difference between libev and libevent? 作者是libev作者 [问]两个库都是为异步io调度而设计,在Linux上都是使用epoll ...
- 转:libev和libevent的设计差异
转:http://www.cnblogs.com/Lifehacker/p/whats_the_difference_between_libevent_and_libev_chinese.html [ ...
- Libev和LibEvent
libev和libevent功能基本相同,名称相近,到底该用哪一个呢?zhouhh@zhh64:~$ sudo apt-cache search libeventlibevent-dev – Deve ...
- 使用 libevent 和 libev 提高网络应用性能——I/O模型演进变化史
构建现代的服务器应用程序需要以某种方法同时接收数百.数千甚至数万个事件,无论它们是内部请求还是网络连接,都要有效地处理它们的操作. 有许多解决方案,但事件驱动也被广泛应用到网络编程中.并大规模部署在高 ...
- 使用 libevent 和 libev 提高网络应用性能
使用 libevent 和 libev 提高网络应用性能 Martin C. Brown, 作家, Freelance 简介: 构建现代的服务器应用程序需要以某种方法同时接收数百.数千甚至数万个事件, ...
- libevent 和 libev 提高网络应用性能
构建现代的服务器应用程序需要以某种方法同时接收数百.数千甚至数万个事件,无论它们是内部请求还是网络连接,都要有效地处理它们的操作.有许多解决方 案,但是 libevent 库和 libev 库能够大大 ...
- 简单对比 Libevent、libev、libuv
Libevent.libev.libuv三个网络库,都是c语言实现的异步事件库Asynchronousevent library). 异步事件库本质上是提供异步事件通知(Asynchronous Ev ...
- 网络库libevent、libev、libuv对比
Libevent.libev.libuv三个网络库,都是c语言实现的异步事件库Asynchronousevent library). 异步事件库本质上是提供异步事件通知(Asynchronous Ev ...
- libevent安装
libevent : 名气最大,应用最广泛,历史悠久的跨平台事件库:libev : 较libevent而言,设计更简练,性能更好,但对Windows支持不够好:libuv : 开发node的过程中需要 ...
随机推荐
- vue组件的hover事件模拟、给第三方组件绑定事件不生效问题
1.vue里面实现hover效果基本需要用事件模拟 <div @mouseover="overShow" @mouseout="outHide"> ...
- Gradle - Manifest
Manifest DSL提供了配置以下Manifest条目的功能: minSdkVersion / targetSdkVersion / versionCode / versionName / app ...
- git版本还原
本地还原 在确认需要进行版本还原以后, 打开GIT BASH 输入: git reset --hard ad76ebf5ba8fb12bc38300ee99db478b332c1f7b 此操作成功以后 ...
- Android -- onAttachedToWindow()
onAttachedToWindow在Activity生命周期中的位置 放大招: onAttachedToWindow不能在onCreate中哟~ View view = getWindow().ge ...
- yield python
原文:http://pyzh.readthedocs.io/en/latest/the-python-yield-keyword-explained.html 3. (译)Python关键字yield ...
- 如何启动docker service
From powershell prompt following works for me with no issues restart-service *docker* [注意] 我试了一下,这个命 ...
- Javascript 面向对象实践
踩到了坑,才能学到东西. 记录我在慢慢的转向模块化遇到的问题以及解决的思路. 1.采用立即执行函数,闭包的方式创建模块 html: <!DOCTYPE html> <html lan ...
- (纪录片)科学的故事:权力、证据与激情 The Story Of Science: Power, Proof And Passion
简介: 导演: 纳特·沙曼编剧: 纳特·沙曼主演: Michael J. Mosley类型: 纪录片官方网站: www.bbc.co.uk/programmes/b00s9mms制片国家/地区: 英国 ...
- Vim的行号、语法显示等设置(.vimrc文件的配置)以及乱码解决
在终端下使用vim进行编辑时,默认情况下,编辑的界面上是没有显示行号.语法高亮度显示.智能缩进 等功能的.为了更好的在vim下进行工作,需要手动设置一个配置文件:.vimrc.在启动vim时,当前用户 ...
- SuperMap入门3——Hello World
Hello World程序很重要,对于入门来说,它可以检测我们的环境.配置是否正确,感受程序的易用性等. 添加工具 由于我是使用的VS2017+ SuperMap iObject绿色免安装版,所以新建 ...