epoll インターフェースとは何か?
epoll は Linux のイベント通知インターフェースで、プログラムが多数の file descriptor を登録し、そのうちどれが入力または出力の準備ができたかを待って知ることができます。古い方式と異なり、そのコストは監視する descriptor の総数に応じて増加しません。これは Linux における高並行性のネットワークサーバーの基盤です。
なぜ重要か
epoll があるおかげで、イベント駆動型のサーバーは 1 つのプロセスで数千の接続を処理でき、これが CI が依存する多くのツールを支えています。これを理解すると、接続ごとに thread を用意せずにノンブロッキング IO がどのようにスケールするかが明確になります。
関連ガイド
What Is the Select System Call?The select system call lets a program wait until any of a set of file descriptors becomes ready for IO, or un…
What Is Non-Blocking IO?Non-blocking IO returns immediately when an operation cannot complete yet, letting a single thread interleave…
What Is an Inotify Watch?An inotify watch is a Linux registration that notifies a program when a specific file or directory changes, p…