V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
dreamlike
V2EX  ›  问与答

io_uring 的一点疑问

  •  
  •   dreamlike · Oct 4, 2022 via Android · 1818 views
    This topic created in 1313 days ago, the information mentioned may be changed or developed.
    我现在刚开始使用 liburing 做 aio
    请各位大佬指正
    如果我 submit 一个对 socket 的读取的 sqe 是不是我需要保证我传入的 buffer 对应的内存至少要在对应 cqe 返回前有效(io_uring_prep_recv)
    如果对端一直都不发送消息 是不是我这块内存就算浪费掉了 感觉要是支持很多连接就会浪费很多内存

    另外一个问题是 io_uring 支持注册 eventfd 进去 我是不是可以网络 io 走 epoll ,文件 io 走 io_uring ,通过 epoll 监听 eventfd 触发收割 cqe ,也能解决上面那个问题
    1 replies    2022-10-04 17:49:14 +08:00
    48y1951r9G8k7Zou
        1
    48y1951r9G8k7Zou  
       Oct 4, 2022   ❤️ 3
    一般实践上是用 automatic buffers

    参考这篇文章: https://lwn.net/Articles/813311/
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1071 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 18:37 · PVG 02:37 · LAX 11:37 · JFK 14:37
    ♥ Do have faith in what you're doing.