MCPcopy Create free account
hub / github.com/axboe/liburing / get_sqe

Function get_sqe

examples/proxy.c:656–671  ·  view source on GitHub ↗

* Special cased for SQPOLL only, as we don't control when SQEs are consumed if * that is used. Hence we may need to wait for the SQPOLL thread to keep up * until we can get a new SQE. All other cases will break immediately, with a * fresh SQE. * * If we grossly undersized our SQ ring, getting a NULL sqe can happen even * for the !SQPOLL case if we're handling a lot of CQEs in our event loop

Source from the content-addressed store, hash-verified

654 * a single submission cycle.
655 */
656static struct io_uring_sqe *get_sqe(struct io_uring *ring)
657{
658 struct io_uring_sqe *sqe;
659
660 do {
661 sqe = io_uring_get_sqe(ring);
662 if (sqe)
663 break;
664 if (!sqpoll)
665 io_uring_submit(ring);
666 else
667 io_uring_sqring_wait(ring);
668 } while (1);
669
670 return sqe;
671}
672
673/*
674 * See __encode_userdata() for how we encode sqe->user_data, which is passed

Callers 8

__submit_receiveFunction · 0.70
queue_shutdown_closeFunction · 0.70
queue_cancelFunction · 0.70
handle_sockFunction · 0.70
submit_sendFunction · 0.70
handle_shutdownFunction · 0.70
open_socketFunction · 0.70
parent_loopFunction · 0.70

Calls 2

io_uring_submitFunction · 0.85
io_uring_get_sqeFunction · 0.50

Tested by

no test coverage detected