Register your product to gain access to bonus material or receive a coupon.
The definitive guide to interprocess communication for Linux - a must-have for serious software developers and sys admins!
° Covers every aspect of Linux interprocess communications in detail
° Zeroes right in on the key techniques of processes and interprocess communication (IPC) - from primitive communications to the complexities of sockets
° Explains Linux internals to sys admins and advanced IPC techniques to software developers
Understanding the concepts of processes and interprocess communications (IPC) is fundamental to developing software for Linux. This book zeroes right in on the key techniques of processes and interprocess communication - from primitive communications to the complexities of sockets. It covers every aspect of UNIX/Linux interprocess communications in sufficient detail to allow experienced programmers to begin writing useful code immediately. The book also includes a precise description of the basics of network programming that make this one of the best introductory books on UNIX/Linux network programming using sockets. Grey explains exactly what processes are, how they are generated, how they can access their own environments, and how they can communicate with other processes. From beginning to end, the book truly leads you through the "nooks and crannies" of UNIX - making you a dramatically more effective programmer. Rave reviews for UNIX companion volume-- "I really like this book!!! Concepts that I only vaguely understood now make complete sense to me! The sample code and exercises are so good, they seem to clamp down on the concepts like a vise grip..." S. Lee Henry, Johns Hopkins University.
There are countless sites on the Internet that deal with Linux and all its variants. It is virtually impossible to generate a list of these sites without leaving out at least one (or more) URLs for which someone will take you to task. This aside, the list below (in no particular order of importance) provides a good starting point. For additional locations and supporting sites, try searching the Internet for the terms GNU, GNU/Linux, Linux, and so on, using any one of the high-powered search engines (e.g., Google, Dogpile, etc.).
Download the Sample Chapter related to this title.
Introduction.
Acknowledgments.
1. Programs and Processes.
Introduction. Library Functions. System Calls. Linking Object Code. Managing Failures. Executable File Format. System Memory. Process Memory. The u Area. Process Memory Addresses. Creating a Process. Summary. Key Terms and Concepts.
Introduction. Process ID. Parent Process ID. Process Group ID. Permissions. Real and Effective User and Group Ids. File System Information. File Information. Process Resource Limits. Signaling Processes. Command-Line Values. Environment Variables. The/proc Filesystem. Summary. Key Terms and Concepts.
Introduction. The fork System Call Revisited. exec's Minions. Using fork and exec Together. Ending a Process. Waiting on Processes. Summary. Key Terms and Concepts.
Introduction. Lock Files. Locking Files. More About Signals. Signal and Signal Management Calls. Summary. Key Terms and Concepts.
Introduction. Unnamed Pipes. Named Pipes. Summary. Key Terms and Concepts.
Introduction. IPC System Calls: A Synopsis. Creating a Message Queue. Message Queue Control. Message Queue Operations. A Client-Server Message Queue Example. Message Queue Class. Summary. Key Terms and Concepts.
Introduction. Creating and Accessing Semaphore Sets. Semaphore Control. Semaphore Operations. Semaphore Class. Summary. Key Terms and Concepts
Introduction. Creating a Shared Memory Segment. Shared Memory Control. Shared Memory Operations. Using a File as Shared Memory. Shared Memory Class. Summary. Key Terms and Concepts.
Introduction. Executing Remote Commands at a System Level. Executing Remote Commands in a Program. Transforming a Local Function Call into a Remote Procedure. Debugging RPC Applications. Using RPCGEN to Generate Templates and a MAKEFILE. Encoding and Decoding Arbitrary Data Types. Using Broadcasting to Search for an RPC Service. Summary. Key Terms and Concepts.
Introduction. Communication Basics. IPC Using Socketpair. Sockets: The Connection-Oriented Paradigm. Sockets: The Connectionless Paradigm. Multiplexing I/O with select. Peeking at Data. Out of Band Messages. Summary. Key Terms and Concepts.
Introduction. Creating a Thread.Exiting a Thread. Basic Thread Management. Thread Attributes. Scheduling Threads. Using Signals in Threads. Thread Synchronization. Thread-Specific Data. Debugging Multithreaded Programs. Summary. Nomenclature and Key Concepts.
Manual Page Sections. Manual Page Format. Standard Linux System Calls.
Introduction. RPC Definitions. RPC Keywords. Some RPC Examples.
Introduction. Sample Program for Profiling. Generating Profile Data. Viewing and Interpreting Profile Data.
The topic of interprocess communication techniques is broad, challenging and dynamic. All but the most basic operating systems provide methods for processes communication. Early on, UNIX supported a number of rudimentary process communication constructs (such as lock files, signals and pipes). In the early 1980s, facilities such as message queues, semaphores, and shared memory were added to the mix by AT&T with its release of UNIX System V. Somewhat concurrently, the Berkeley Software Distribution added support for Internet protocols (4.3BSD) and the socket interface as a communication construct. By the mid-1990s, threads and multithreaded programming techniques were making significant, permanent inroads into the UNIX mainstream.
Along the way, UNIX spawned innumerable UNIX-like operating systems. One such operating system was MINIX. MINIX, written by Andrew S. Tanenbaum, is a small (about twelve thousand lines) PC version of UNIX. MINIX was presented as a pedagogical tool to permit the user to gain a better understanding of the inner working of a UNIX-like operating system. As all of the operating system source code was provided, the user could tinker with the code and refine its functionality. As a university student, Linus Torvalds' exposure to MINIX led him to develop a more robust UNIX-like operating system called Linux. In brief, Linux is a freely distributed hybrid version of UNIX. Linux system administration is BSD-like while its programming environment has a definite AT&T flavor. A number of commercial versions of Linux populate the market. These versions bundle Linux with a variety of other operating system related utilities and software packages. One of the more widely distributed commercial versions is Red Hat Linux. Red Hat Linux includes Richard Stallman's GNU project C (gcc) and C++ (g++) compilers.
This text explores the intricacies of interprocess communications as supported by Red Hat Linux version 7.3 and 8.0. It is assumed that the reader has a working knowledge of C/C++ programming. It is further assumed that while not being an expert, the reader has worked in a UNIX type environment and is reasonably familiar with generating and editing text using an editor such as vi or pico (available from the University of Washington). This text makes extensive references to specific system calls and predefined library functions. The reader is encouraged to read the manual pages for each system call/library function as it is encountered. As in UNIX, the manual pages in Linux are an unparalleled source of information. Appendix A covers the format and use of manual pages.
All programming references and examples were generated on a PC Pentium-based platform running Red Hat Linux 7.3, using the GNU C/C++ compiler version 2.96. With the release of Red Hat Linux 8.0 and GNU 3.2 the examples were revisited and tweaked where necessary. Many of the examples and most of the exercises have also been compiled and run in a Solaris 2.8 setting using GNU 2.95. Most often, few if any modifications were needed to generate clean, executable code in this alternate environment.
Each example is a complete standalone program. Command line examples, except where noted, are Korn shell based. In any setting, IPC (interprocess communication) support must be available for the user to pursue the materials covered in the chapters on semaphores, message queues, and shared memory. When Linux is installed, usually IPC support is enabled (check the /proc directory for the presence of the sysvipc directory). If it is not present you may need to modify system configuration files and recompile the kernel. There are a number of places that one can peruse for information on how this might be done. One source of information is the Configure.help file that resides in the /usr/src/linuxXXXX/Documentation subdirectory (where XXXX is the version of Linux). However, unless you are the system administrator, you most likely will want to seek help when doing this. To work with threads, a POSIX compliant thread library (such as LinuxThreads) must be available. Fortunately, most new versions of Linux come with thread libraries that are distributed with the GNU compiler (check the /usr/lib directory for files names containing pthread, e.g., libpthread.a or libpthread.so).
Download the Index
file related to this title.