]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - share/doc/psd/21.ipc/1.t
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / share / doc / psd / 21.ipc / 1.t
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
45 1. INTRODUCTION
46 .sp 2
47 .R
48 .NL
49 One of the most important additions to UNIX in 4.2BSD was interprocess
50 communication.
51 These facilities were the result of
52 more than two years of discussion and research.  The facilities
53 provided in 4.2BSD incorporated many of the ideas from current
54 research, while trying to maintain the UNIX philosophy of
55 simplicity and conciseness.
56 The 4.3BSD release of Berkeley UNIX
57 improved upon some of the IPC facilities
58 while providing an upward-compatible interface.
59 4.4BSD adds support for ISO protocols and IP multicasting.
60 The BSD interprocess communication
61 facilities have become a defacto standard for UNIX.
62 .PP
63 UNIX has previously been very weak in the area of interprocess
64 communication.  Prior to the 4BSD facilities, the only
65 standard mechanism which allowed two processes to communicate were
66 pipes (the mpx files which were part of Version 7 were
67 experimental).  Unfortunately, pipes are very restrictive
68 in that
69 the two communicating processes must be related through a
70 common ancestor.
71 Further, the semantics of pipes makes them almost impossible
72 to maintain in a distributed environment. 
73 .PP
74 Earlier attempts at extending the IPC facilities of UNIX have
75 met with mixed reaction.  The majority of the problems have
76 been related to the fact that these facilities have been tied to
77 the UNIX file system, either through naming or implementation.
78 Consequently, the IPC facilities provided in 4.2BSD were
79 designed as a totally independent subsystem.  The BSD IPC
80 allows processes to rendezvous in many ways. 
81 Processes may rendezvous through a UNIX file system-like
82 name space (a space where all names are path names)
83 as well as through a
84 network name space.  In fact, new name spaces may
85 be added at a future time with only minor changes visible
86 to users.  Further, the communication facilities 
87 have been extended to include more than the simple byte stream
88 provided by a pipe.  These extensions have resulted
89 in a completely new part of the system which users will need
90 time to familiarize themselves with.  It is likely that as
91 more use is made of these facilities they will be refined;
92 only time will tell.
93 .PP
94 This document provides a high-level description
95 of the IPC facilities in 4.4BSD and their use.
96 It is designed to complement the manual pages for the IPC primitives
97 by examples of their use.
98 The remainder of this document is organized in four sections.  
99 Section 2 introduces the IPC-related system calls and the basic model
100 of communication.  Section 3 describes some of the supporting
101 library routines users may find useful in constructing distributed
102 applications.  Section 4 is concerned with the client/server model
103 used in developing applications and includes examples of the
104 two major types of servers.  Section 5 delves into advanced topics
105 which sophisticated users are likely to encounter when using
106 the IPC facilities.