Sockets - Applying the Unix Readiness Model When Composing Concurrent Operations in C++
summary
Claim: the Unix readiness model is practical to compose concurrent C++ operations by making senders and awaitables look like sockets. Implements a select-equivalent C++ library with epoll-style registration, intrusive circular linked lists for subscriptions, and notify objects that wake waiting callers. Demonstrates a real 250ms happy eyeballs delay example and FD-passing cancellation via a Unix domain socket. The code maps to senders/receivers and coroutines, is implemented end-to-end, and the approach works with the expected runtime tradeoffs.
AI-written summary · about
chapters (21)
- 0:00Introduction
- 0:41Concurrent code structure
- 5:16Sockets basics
- 9:53Busy waiting vs select
- 13:45Unix readiness model
- 14:10Happy Eyeballs algorithm
- 17:41Happy Eyeballs with epoll
- 21:10C++ socket abstractions
- 24:45Waiting vs non-waiting code
- 25:06Unix pipes as sockets
- 28:13Non-blocking pipes in C++
- 30:00Select for multiple handles
- 32:50Intrusive lists for events
- 37:44Select object implementation
- 41:37Select operations
- 46:12Select for data spans
- 47:36Handles for objects
- 48:19Connecting senders and receivers
- 50:44Wait for any vs when any
- 51:48Select as a sender
- 53:56Summary
related talks
01h 01mC++ Sender Patterns to Wrangle C++ Concurrency in Embedded Devices
01h 04m[old version]The C++20 Synchrononization Library
01h 04mThe C++20 Synchronization Library
32mTechniques for writing concurrent applications with asynchronous I/O
02h 02mCloud Native Rust Workshop: Let's go parallel with Rust
57m[filtered] Asynchronous C++ Programming
56mThe C++ Execution Model
58mAn Introduction to C++ Coroutines
