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