3 ms·
Does this imply that the caller has to poll the result buffer to know when the kernel has processed the initial data?
by throwaway894345 3y ago
Does this imply that the caller has to poll the result buffer to know when the kernel has processed the initial data?
- sophacles 3y agoSort of. In the strictest sense, yes - the cq is a ring buffer (implemented with fancy atomic stuff), so you have to check if there is a completion on the queue before you read the entry. However, this doesn't need a syscall to do polling, if more completions come in while you're processing, they will be available to you. There's also a syscall (io_uring_enter) that will do a context switch and wake you up when completions are available (it's a complicated syscall, that has a lot of knobs and switches and levers - just be ready for a LOT of information if you go read the man page).