-
I'm trying to put together a project (https://github.com/nibanks/eventq) to compare different queue mechanism across platforms (IOCP, epoll, kqueue, io_uring) and I'm having problems figuring out io_uring. It seems if I initialize the queue with a depth more than 1, then bool eventq_initialize(eventq* queue) {
return 0 == io_uring_queue_init(1, queue, 0);
}
void eventq_enqueue(eventq queue, eventq_sqe* sqe, uint32_t type, void* user_data, uint32_t status) {
sqe->type = type;
sqe->user_data = user_data;
sqe->status = status;
struct io_uring_sqe *io_sqe = io_uring_get_sqe(&queue);
if (io_sqe == NULL) {
printf("io_uring_get_sqe returned NULL\n"); // <---- This is printed out if > 1 is passed to io_uring_queue_init.
return;
}
io_uring_prep_nop(io_sqe);
io_uring_sqe_set_data(io_sqe, sqe);
io_uring_submit(&queue); // TODO - Extract to separate function?
} If I can get this working, we might integrate into Windows (my team owns the Windows networking stack and APIs), https://github.com/microsoft/msquic, and/or https://github.com/microsoft/xdp-for-windows. So I'd really like to figure this out. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Do you have a full example that shows this issue? Not something I'd seen before, and I'm 99.99% sure it's a bug in the app. But can't really say much with the code excerpt. |
Beta Was this translation helpful? Give feedback.
Do you have a full example that shows this issue? Not something I'd seen before, and I'm 99.99% sure it's a bug in the app. But can't really say much with the code excerpt.