-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proper way to wait for multiple CQEs no longer than the specified period of time #693
Comments
I'm quite sure io_uring_wait_cqe_timeout only waits timeout time, not multilpied |
this is true, but the rest of the CQE's will be available. you could either use io_uring_peek_batch_cqe or just io_uring_peek_cqe after this call. Perhaps there should be a io_uring_wait_cqes_batch method too |
|
Forget I said this In your code, you only process one cqe before looping again (and waiting on the timeout, again) resulting in your |
Like was mentioned in previous comments, your initial wait may return more than one cqe. You iterate over them once the call returns, and then advance the cq ring to indicate you consumed them. I do think it'd be nice if we have a io_uring_wait_cqes_timeout(ring, nr, timeout) so this could be done easily. That would return when either |
What about making |
It already does that. |
As of
|
Try upgrading your liburing library if that's really the case. But also, when zero cqes are returned, it's not success. |
For the submission like the following:
what it the proper way to wait for
nr
CQEs no longer than the specified period of time? Doingmay yield in
nr * timeout
time spent waiting. OTOHio_uring_wait_cqes()
seems always returns the only CQE regardless on how much of the expected ones was specified inwait_nr
argument.The text was updated successfully, but these errors were encountered: