Summary
Concurrent I/O is essential for connection-oriented servers to service multiple clients. Concurrency can also be useful in client code to avoid deadlock situations.
This chapter introduced forking, the most common technique for achieving concurrency. Forking is generally easy to use, but it has a few things to watch for, the most important being the need to wait on exited child processes. It is also common for production servers to detach themselves from the controlling terminal and autobackground themselves. In this chapter we developed a become_daemon() subroutine to do this.
On UNIX systems, the inetd superdaemon provides a simple way to turn ordinary command-line applications into forking servers. You can also use it as a handy way ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access