Fast vs. Slow System Calls: How Signals Wake Up Blocked System Calls
2025-06-03
This article delves into the core differences between fast and slow system calls in operating systems. Fast system calls (like `getpid()`) return immediately, while slow system calls (like `read()`) may block waiting for external events. The article focuses on how signals interrupt blocked slow system calls, demonstrating with code examples how to handle `EINTR` errors and use the `SA_RESTART` flag. It also explores the nuances of disk I/O and how the kernel handles different system call types, comparing the strengths and weaknesses of various I/O models (blocking I/O, non-blocking I/O, I/O multiplexing, signal-driven I/O, asynchronous I/O, and I/O Uring).
Read more