ノンブロッキング IO とは何か?
ノンブロッキング IO は、読み取りや書き込みの呼び出しが待機せずに即座に戻り、データがまだ準備できていないことを報告するモデルです。プログラムはその後、通常は epoll のような準備状態インターフェースに導かれて後から戻り、descriptor の準備ができたときに再試行します。これにより、1 つのスレッドが特定の接続で停止することなく、多数の接続を処理できます。
なぜ重要なのか
ノンブロッキング IO は、イベント駆動型のサーバーが少数のスレッドで高い並行性を扱う方法であり、CI で使われる高速なネットワークツールの基盤となっています。そのトレードオフは、各操作の準備状態を追跡しなければならない、より複雑なコードです。
関連ガイド
What Is Blocking IO?Blocking IO pauses the calling thread until an input or output operation finishes, so the thread cannot do ot…
What Is the Epoll Interface?Epoll is a Linux mechanism for efficiently watching many file descriptors at once and being told which are re…
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…