Unknown | 106 lines | 106 code | 0 blank | 0 comment | 0 complexity | b5486d5655a60b27d299b7a83028d3dc MD5 | raw file
1.\" Copyright (c) 1986, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)1.t 8.1 (Berkeley) 8/14/93 33.\" 34.\".ds LH "4.4BSD IPC Primer 35.\".ds RH Introduction 36.\".ds RF "Leffler/Fabry/Joy 37.\".ds LF "\*(DY 38.\".ds CF " 39.nr H1 1 40.LP 41.bp 42.LG 43.B 44.ce 451. INTRODUCTION 46.sp 2 47.R 48.NL 49One of the most important additions to UNIX in 4.2BSD was interprocess 50communication. 51These facilities were the result of 52more than two years of discussion and research. The facilities 53provided in 4.2BSD incorporated many of the ideas from current 54research, while trying to maintain the UNIX philosophy of 55simplicity and conciseness. 56The 4.3BSD release of Berkeley UNIX 57improved upon some of the IPC facilities 58while providing an upward-compatible interface. 594.4BSD adds support for ISO protocols and IP multicasting. 60The BSD interprocess communication 61facilities have become a defacto standard for UNIX. 62.PP 63UNIX has previously been very weak in the area of interprocess 64communication. Prior to the 4BSD facilities, the only 65standard mechanism which allowed two processes to communicate were 66pipes (the mpx files which were part of Version 7 were 67experimental). Unfortunately, pipes are very restrictive 68in that 69the two communicating processes must be related through a 70common ancestor. 71Further, the semantics of pipes makes them almost impossible 72to maintain in a distributed environment. 73.PP 74Earlier attempts at extending the IPC facilities of UNIX have 75met with mixed reaction. The majority of the problems have 76been related to the fact that these facilities have been tied to 77the UNIX file system, either through naming or implementation. 78Consequently, the IPC facilities provided in 4.2BSD were 79designed as a totally independent subsystem. The BSD IPC 80allows processes to rendezvous in many ways. 81Processes may rendezvous through a UNIX file system-like 82name space (a space where all names are path names) 83as well as through a 84network name space. In fact, new name spaces may 85be added at a future time with only minor changes visible 86to users. Further, the communication facilities 87have been extended to include more than the simple byte stream 88provided by a pipe. These extensions have resulted 89in a completely new part of the system which users will need 90time to familiarize themselves with. It is likely that as 91more use is made of these facilities they will be refined; 92only time will tell. 93.PP 94This document provides a high-level description 95of the IPC facilities in 4.4BSD and their use. 96It is designed to complement the manual pages for the IPC primitives 97by examples of their use. 98The remainder of this document is organized in four sections. 99Section 2 introduces the IPC-related system calls and the basic model 100of communication. Section 3 describes some of the supporting 101library routines users may find useful in constructing distributed 102applications. Section 4 is concerned with the client/server model 103used in developing applications and includes examples of the 104two major types of servers. Section 5 delves into advanced topics 105which sophisticated users are likely to encounter when using 106the IPC facilities.