mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
udp: uring: wait for num_send_added.max(1), improve comments
This commit is contained in:
parent
f89bdce7f0
commit
fe294e8119
1 changed files with 7 additions and 6 deletions
|
|
@ -153,8 +153,9 @@ impl SocketWorker {
|
|||
let recv_entry = self
|
||||
.recv_helper
|
||||
.create_entry(self.buf_ring.bgid().try_into().unwrap());
|
||||
// This timeout makes it possible to avoid busy-polling and enables
|
||||
// regular updates of pending_scrape_valid_until
|
||||
// This timeout enables regular updates of pending_scrape_valid_until
|
||||
// and wakes the main loop to send any pending responses in the case
|
||||
// of no incoming requests
|
||||
let pulse_timeout_entry = Timeout::new(&self.pulse_timeout as *const _)
|
||||
.build()
|
||||
.user_data(USER_DATA_PULSE_TIMEOUT);
|
||||
|
|
@ -250,11 +251,11 @@ impl SocketWorker {
|
|||
}
|
||||
}
|
||||
|
||||
// Wait for all sendmsg entries to complete, as well as at least
|
||||
// one recvmsg or timeout, in order to avoid busy-polling if there
|
||||
// is no incoming data.
|
||||
// Wait for all sendmsg entries to complete. If none were added,
|
||||
// wait for at least one recvmsg or timeout in order to avoid
|
||||
// busy-polling if there is no incoming data.
|
||||
ring.submitter()
|
||||
.submit_and_wait(num_send_added + 1)
|
||||
.submit_and_wait(num_send_added.max(1))
|
||||
.unwrap();
|
||||
|
||||
for cqe in ring.completion() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue