-
tl;dr What's the guarantee about I try to make async network (TCP stream socket) protocol with "iodepth" (client and server are sequential and have only one thread, but they may generate more than 1 "async" request, you can think about it as a storage protocol, maybe like nvmeotcp), so there may be X commands incoming, and I wanted to answer to them via I use
, where I send data in one uring SQE and submit it before any manipulations with buffer. BUT when I submitted more than 22 such inflight SQEs with 4+KB of data each, on 1500MTU physical network between client<->server I've got some racy mixed up data from several sendmsgs intersected. I see that CQEs come in different order and that's ok, but send data atomicity is a problem. Maybe it's a question about I can't reproduce it if server and client are on the same machine even with 64 "parallel" inflight |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If the file provides no atomicity guarantees, there can be no atomicity with io_uring requests. If that's about ordering the execution of io_uring requests, there has already been a couple of threads answering in more details, but in short, request can be executed in any order and they can even be executed in halfs. So, totally possible that one request pushes its first half of data, then another request gets executed, and only then the first requests completes. Userspace must order requests in userspace. |
Beta Was this translation helpful? Give feedback.
If the file provides no atomicity guarantees, there can be no atomicity with io_uring requests.
If that's about ordering the execution of io_uring requests, there has already been a couple of threads answering in more details, but in short, request can be executed in any order and they can even be executed in halfs. So, totally possible that one request pushes its first half of data, then another request gets executed, and only then the first requests completes. Userspace must order requests in userspace.