Linux I/O多路复用之select()/poll()/epoll()
poll_initwait(&table):就是将__pollwait设为回调函数
poll函数:后面会去调用驱动程序的poll函数,poll函数调用pollwait就等于调用__pollwait,将当前进程加入到等待队列中,以便唤醒休眠后的当前进程。
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。然后返回当前驱动设备的状态(mask),以便收集设备的事件。
schedule_timeout(__timeout):休眠函数,如果发生事件,就会被唤醒。
select函数:select---->sys_select()---->core_sys_select()---->do_select();下面是do_select的工作流程:
poll()函数:poll和select本质上是一样的,只是poll没有最大连接数的限制,因为poll是存储在链表里的。
参考文献:
https://www.jianshu.com/p/da6642369ef0
https://blog.csdn.net/wendy_keeping/article/details/76659517
https://www.cnblogs.com/alantu2018/p/8612722.html
https://blog.csdn.net/hhhanpan/article/details/80633101
https://www.cnblogs.com/aspirant/p/9166944.html
https://www.cnblogs.com/panfeng412/articles/2229095.html

更多精彩