ALTERNATIVE I/O MODELS
This chapter discusses three alternatives to the conventional file I/O model that we
have employed in most programs shown in this book:
z I/O multiplexing (the select() and poll() system calls);
z signal-driven I/O; and
z the Linux-specific epoll API.
63.1 Overview
Most of the programs that we have presented so far in this book employ an I/O
model under which a process performs I/O on just one file descriptor at a time,
and each I/O system call blocks until the data is transferred. For example, when
reading from a pipe, a read() call normally blocks if no data is currently present in
the pipe, and a write() call blocks if there is insufficient space in the pipe to hold the
data to be written. Similar behavior occurs when performing I/O on various other
types of files, including FIFOs and sockets.