kbio icon indicating copy to clipboard operation
kbio copied to clipboard

Remove the polling when there is no free slot

Open hidva opened this issue 4 years ago • 0 comments

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.

hidva avatar Sep 24 '21 02:09 hidva