最近我在阅读Redis。 Redis基于I/O多路复用实现了一个简单的事件驱动库。 Redis表示它会选择系统支持的最佳多路复用方法,并给出了以下代码:
/* 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
我想知道它们是否有根本的性能差异?如果有,为什么?
最好的问候