Skip to content

would io_uring_submit_and_wait() count cqe from other operations? #1058

Answered by axboe
pyhd asked this question in Q&A
Discussion options

You must be logged in to vote

There's no way to wait for specific completions, so if you do io_uring_submit_and_wait(ring, nr), then it'll return when 'nr' CQEs are available for you, regardless of where they come from. Generally, if you want to wait for N new receives to come in, you'd probably want to adjust your 'nr' so that it's N+submitted_sends. The sends will generally always complete during submission (unless you're overflowing the socket and it's out of space), hence you should expect the sends you're submitting here to be available in the ring at the time io_uring_submit() (or io_uring_submit_and_wait()) returns control to your application.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by axboe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants