Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7402213
  • 博文数量: 1756
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 16232
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
个人简介

啥也没写

文章分类

全部博文(1756)

文章存档

2024年(2)

2023年(44)

2022年(39)

2021年(46)

2020年(43)

2019年(27)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(143)

2011年(228)

2010年(263)

2009年(384)

2008年(246)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类: LINUX

2011-10-15 00:08:51

各个系统上的高效的 multiplex 方法,BSD 有 kqueu,Linux 有 epoll, Solaris 有 /dev/poll。此处 "高效" 是相对传统的 select/poll 说的。

一 
Kqueue is a scalable event notification interface that first appeared in FreeBSD 4.1 [...] Some other operating systems which traditionally only supported select(2) and poll(2) also currently provide more efficient polling alternatives, such as epoll(7) on Linux and /dev/poll(4) on Solaris.
二 bind 的 configure --help:
--enable-kqueue use BSD kqueue when available [default=yes] --enable-epoll use Linux epoll when available [default=auto] --enable-devpoll use /dev/poll when available [default=yes]
三 源代码 bind-version/lib/isc/unix/socket.c:
/*%  * Choose the most preferable multiplex method.  */ #ifdef ISC_PLATFORM_HAVEKQUEUE #define USE_KQUEUE #elif defined (ISC_PLATFORM_HAVEEPOLL) #define USE_EPOLL #elif defined (ISC_PLATFORM_HAVEDEVPOLL) #define USE_DEVPOLL typedef struct { unsigned int want_read : 1, want_write : 1; } pollinfo_t; #else #define USE_SELECT #endif /* ISC_PLATFORM_HAVEKQUEUE */转:http://blog.zhangsen.org/2010/10/various-multiplex-methods.html 
阅读(1224) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~