linux - 在 1 个 io_submit 调用中的 N 个请求中排序
问题描述
- 如果 1 次 io_submit 调用包含对相同(偏移量,Len)的读取和写入请求,读取是否保证看到写入写入的值?
- 如果 1 个单个 io_submit 调用包含 2 个对相同(偏移量、Len)的写操作,哪个将首先执行?
在这两个示例中, io_submit 调用中的 NR = 2。
我的理解是,在这两个示例中,NR 子请求都可以按任意顺序处理。
正确的?
解决方案
如果 1 次 io_submit 调用包含对相同(偏移量,Len)的读取和写入请求,读取是否保证看到写入写入的值?
No,
如果 1 个单个 io_submit 调用包含 2 个对相同(偏移量、Len)的写操作,哪个将首先执行?
The one having lower index in array of pointers to struct iocb.
The requests are submitted to the internal queue of the io_context_t which are then read for completions. So ordering is of a queue and the algorithm used.
推荐阅读
- reactjs - React Hook useEffect 缺少依赖项 - 问题
- reactjs - React.useContext 未定义
- c# - 为什么文字没有显示在屏幕上?
- javascript - 如何通过将一个数组从另一个数组交叉到持续 30 天来找到一个数组的平均价格?javascript
- javascript - 使 Angular mat-dialog modal 听键盘组合
- swiftui - 如何在 ForEach 中转换不同的 SwiftUI View 结构来显示?
- loops - ffmpeg 复杂过滤器 pip 循环不起作用
- typescript - 查找表的正确键入
- grafana - Grafana 的新手,这种图表的图表/插件是什么?
- php - 如何格式化 PostgreSQL 查询结果以使用 PHP 从关联数组中提取 GeoJSON 对象?