Skip to content
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

Remove the polling when there is no free slot #1

Open
hidva opened this issue Sep 24, 2021 · 0 comments
Open

Remove the polling when there is no free slot #1

hidva opened this issue Sep 24, 2021 · 0 comments

Comments

@hidva
Copy link
Contributor

hidva commented Sep 24, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant