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.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of things

things

Related news:

News photo

A study found that X’s algorithm now loves two things: Republicans and Elon Musk

News photo

PayPal once again lets you pool money from others to pay for things together

News photo

New iMac, Mac Mini, and MacBook Pro Launch Tomorrow: 10 Things You Should Know