I/O模型--select与poll.
时间:2010-09-28 来源:noyear
Unix五种I/O模型:
阻塞I/O模型
非阻塞I/O模型
I/O复用模型
信号驱动I/O模型
异步I/O模型
复用模型常用函数select和poll.select函数相关的四个宏:
void FD_ZERO (fd_set * fdset); //clear all bits in fdset
void FD_SET (int fd, fd_set *fdset); // turn on the bit for fd in
fdset
void FD_CLR (int fd, fd_set *fdset); // turn off the bit for fd in
fdset
int FD_ISSET (int fd, fd_set * fdset); // is the bit for fd on in
fdset ?*/
select中三个指针变量指向readset,writeset,exceptset他们都是值-結果参
数。
最大描述字指待测试的描述字个数,它的值是待测试的最大描述字加1。
相关阅读 更多 +
排行榜 更多 +