|
|
|
|
|
by sriram_malhar
668 days ago
|
|
The consumer (background thread) only polls; there is no need to wake up the consumer. At steady state, the consume is either blocked on I/O or is scanning the producer buffers. When all producer buffers are empty, it can just sleep for a short time. |
|
And in fact ... the wait-free wakeup part of this is already there. Now that io_uring has futex support, a producer can enable kernel-side busy polling on the uring, and then submit a FUTEX_WAKE to the ring without doing any sys calls. This Github issue [1] has a nice description.
[1] https://github.com/axboe/liburing/issues/385