Understanding OS-Backed Event Queues, System Calls, and Cross-Platform Abstractions
In this chapter, we’ll take a look at how an OS-backed event queue works and how three different operating systems handle this task in different ways. The reason for going through this is that most async runtimes I know of use OS-backed event queues such as this as a fundamental part of achieving high-performance I/O. You’ll most likely hear references to these frequently when reading about how async code really works.
Event queues based on the technology we discuss in this chapter is used in many popular libraries like:
- mio (https://github.com/tokio-rs/mio), a key part of popular runtimes like Tokio
- polling (https://github.com/smol-rs/polling), the event queue used in Smol and async-std
- libuv (https://libuv.org/), the library used to create the event queue used in Node.js (a JavaScript runtime) and the Julia programming language
- C# for its asynchronous network calls...