摘要: 使用aio的时候, 出现编译问题: 对‘aio_read’未定义的引用( undefined reference to 'aio_read' ). 要如何解决 ? 确认已经include头文件 aio.h; 编译的时候, 链接librt库, 命令: $ gcc async_demo.c -lrt 选 阅读全文
posted @ 2021-05-25 14:35 明明1109 阅读(769) 评论(0) 推荐(0) 编辑
摘要: 1.select和poll IO多路转换技术, select, poll的原理是: 通过将待监听文件描述符(fd)加入集合, 然后通过查询其调用返回值, 取得数据有动静的fd数量, 再轮询集合中每个fd, 如果有数据, 就直接读取; 如果没有数据, 就等待下一次查询. select和poll实现了异 阅读全文
posted @ 2021-05-25 01:27 明明1109 阅读(2395) 评论(0) 推荐(0) 编辑