Get the latest tech news
Waiting for many things at once with io_uring
When doing systems programming we often need to wait for something to happen. Common examples might be waiting for some data to come through a socket or waiting on a lock. We also often want to wait on any of several conditions to become true. A web server might be handling many sockets at once, waiting for any number of them to become readable or writeable. This short blog post is concerned with the latter scenario in Linux. Until recently there was no generic framework which allowed us to wait on many arbitrary events, but now there is, thanks to `io_uring`.
A web server might be handling many sockets at once, waiting for any number of them to become readable or writeable. For instance we might implement a queue using a futex, so that a consumer can read from it, blocking until at least an element is present. Concurrency primitives can then be built on top of futex and friends, allowing for seamless interaction between IO and user space synchronization.
Or read this on Hacker News