did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780130810816

UNIX Network Programming, Volume 2: Interprocess Communications

by
  • ISBN13:

    9780130810816

  • ISBN10:

    0130810819

  • Edition: 2nd
  • Format: Hardcover
  • Copyright: 1999-01-01
  • Publisher: Prentice Hall
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $72.51

Summary

Well-implemented interprocess communications (IPC) are key to the performance of virtually every non-trivial UNIX program. In UNIX Network Programming, Volume 2, Second Edition, legendary UNIX expert W. Richard Stevens presents a comprehensive guide to every form of IPC, including message passing, synchronization, shared memory, and Remote Procedure Calls (RPC). Stevens begins with a basic introduction to IPC and the problems it is intended to solve. Step-by-step you'll learn how to maximize both System V IPC and the new Posix standards, which offer dramatic improvements in convenience and performance.

Table of Contents

Preface.

I. INTRODUCTION.

1. Introduction.
2. Posix IPC.
3. System V IPC.

II. MESSAGE PASSING.

4. Pipes and FIFOs.
5. Posix Message Queues.
6. System V Message Queues.

III. SYNCHRONIZATION.

7. Mutexes and Condition Variables.
8. Read-Write Locks.
9. Record Locking.
10. Posix Semaphores.
11. System V Semaphores.

IV. SHARED MEMORY.

12. Shared Memory Introduction.
13. Posix Shared Memory.
14. System V Shared Memory.

V. REMOTE PROCEDURE CALLS.

15. Doors.
16. Sun RPC.
Epilogue.
Appendix A: Performance Measurements.
Appendix B: A Threads Primer.
Appendix C: Miscellaneous Source Code.
Appendix D: Solutions to Selected Exercises.
Bibliography.
Index.

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Excerpts

Preface Introduction Most nontrivial programs involve some form of IPC or Interprocess Communication. This is a natural effect of the design principle that the better approach is to design an application as a group of small pieces that communicate with each other, instead of designing one huge monolithic program. Historically, applications have been built in the following ways: 1. One huge monolithic program that does everything. The various pieces of the program can be implemented as functions that exchange information as function parameters, function return values, and global variables. 2. Multiple programs that communicate with each other using some form of IPC. Many of the standard Unix tools were designed in this fashion, using shell pipelines (a form of IPC) to pass information from one program to the next. 3. One program comprised of multiple threads that communicate with each other using some type of IPC. The term IPC describes this communication even though it is between threads and not between processes. Combinations of the second two forms of design are also possible: multiple processes, each consisting of one or more threads, involving communication between the threads within a given process and between the different processes. What I have described is distributing the work involved in performing a given application between multiple processes and perhaps among the threads within a process. On a system containing multiple processors (CPUs), multiple processes might be able to run at the same time (on different CPUs), or the multiple threads of a given process might be able to run at the same time. Therefore, distributing an application among multiple processes or threads might reduce the amount of time required for an application to perform a given task. This book describes four different forms of IPC in detail: 1. message passing (pipes, FIFOs, and message queues), 2. synchronization (mutexes, condition variables, read-write locks, file and record locks, and semaphores), 3. shared memory (anonymous and named), and 4. remote procedure calls (Solaris doors and Sun RPC). This book does not cover the writing of programs that communicate across a computer network. This form of communication normally involves what is called the sockets API (application program interface) using the TCP/IP protocol suite; these topics are covered in detail in Volume 1 of this series Stevens 1998. One could argue that single-host or nonnetworked IPC (the subject of this volume) should not be used and instead all applications should be written as distributed applications that run on various hosts across a network. Practically, however, single-host IPC is often much faster and sometimes simpler than communicating across a network. Techniques such as shared memory and synchronization are normally available only on a single host, and may not be used across a network. Experience and history have shown a need for both nonnetworked IPC (this volume) and IPC across a network (Volume 1 of this series). This current volume builds on the foundation of Volume 1 and my other four books, which are abbreviated throughout this text as follows: UNPv1: UNIX Network Programming, Volume 1 Stevens 1998, APUE: Advanced Programming in the UNIX Environment Stevens 1992, TCPv1: TCP/IP Illustrated, Volume 1 Stevens 1994, TCPv2: TCP/IP Illustrated, Volume 2 Wright and Stevens 1995, and TCPv3: TCP/IP Illustrated, Volume 3 Stevens 1996. Although covering IPC in a text with "network programming" in the title might seem odd, IPC is often used in networked applications. As stated in the Preface of the 1990 edition of UNIX Network Programming, "A requisite for understanding how to develop software for a network is an understanding of interprocess communication (IPC)." Changes from the F

Rewards Program