kbio
kbio copied to clipboard
Remove the polling when there is no free slot
Curently we will keep polling when there is no free slot.
if let Some(slot) = future.uring.submit(sqe) {
// ...
} else {
// There is no free slot.
// We expect that wake_by_ref() will put the task at tail of task queue.
// But Tokio will put the task at "next task" slot, so it will run again immediately.
cx.waker().wake_by_ref();
return Poll::Pending;
}
I am working to remove the polling. I will save the waker in the free list when there is no slot, and invoke waker.wake() when others release the slot.