Without the Futex, It's Futile
5 days ago
- #futex
- #concurrency
- #multiprocessor-programming
- The article critiques 'The Art of Multiprocessor Programming, 2nd Edition' for omitting the futex, a crucial concurrency primitive.
- Futex (Fast User-space Mutex) is a building block for modern concurrency primitives, significantly improving performance over System V IPC.
- The futex separates locking from waiting, allowing efficient thread blocking and waking without unnecessary system calls.
- The article provides detailed code examples for implementing mutexes using futexes, including spin locks, basic mutexes, and recursive mutexes.
- It highlights the importance of ownership checks in mutex implementations to prevent accidental unlocks and deadlocks.
- The author discusses the limitations of the book, such as its lack of coverage of modern concurrency practices and async runtimes.
- The article concludes with a call for CS textbooks to include up-to-date and practical content, not just historical theory.