3
我最近在读Redis。 Redis基于I/O多路复用实现了一个简单的事件驱动库。 Redis的说,它会选择系统所支持的最佳复用,并给出了下面的代码:select,epoll,kqueue和evport之间的根本区别是什么?
/* Include the best multiplexing layer supported by this system.
* The following should be ordered by performances, descending. */
#ifdef HAVE_EVPORT
#include "ae_evport.c"
#else
#ifdef HAVE_EPOLL
#include "ae_epoll.c"
#else
#ifdef HAVE_KQUEUE
#include "ae_kqueue.c"
#else
#include "ae_select.c"
#endif
#endif
#endif
我想知道他们是否有基本的性能差异?如果是这样,为什么?
问候
谢谢。我发现这篇文章有帮助。 http://www.eecs.berkeley.edu/~sangjin/2012/12/21/epoll-vs-kqueue.html – 2014-10-19 01:28:38