O'Reilly logo

The Linux Programming Interface by Michael Kerrisk

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 63. 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:

  • I/O multiplexing (the select() and poll() system calls);

  • signal-driven I/O; and

  • the Linux-specific epoll API.

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required