Thomasdezeeuw / a10

Library safely exposing the io_uring API.
MIT License
50 stars 2 forks source link

Don't make submission when not polling in SubmissionQueue::wake #75

Open Thomasdezeeuw opened 1 year ago

Thomasdezeeuw commented 1 year ago

The current SubmissionQueue::wake implementation always adds an event, even if we're not currently polling. We can try to keep track when we're polling and only then add a submission, otherwise it would be an no-op.

I already have a implementation for this based on Mio's Waker: https://github.com/Thomasdezeeuw/heph/blob/64a3e330dc9f3bdc40a4cb61b004ec17501cf2d8/rt/src/thread_waker.rs.

Thomasdezeeuw commented 1 year ago

Could also return a boolean indicating whether or not the ring was actually awoken (vs. not polling).

Thomasdezeeuw commented 8 months ago

Commit f752da0 improves this a little bit.