Interprocess communication
UnixWare provides several mechanisms that
allow processes to exchange data and synchronize
execution.
The simpler of these mechanisms are pipes, named pipes, and signals.
These are limited, however, in what they can do.
For instance,
-
Pipes do not allow unrelated processes to communicate.
-
Named pipes allow unrelated processes to communicate,
but they cannot
provide private channels for pairs of
communicating processes;
that is, any process with appropriate permission may read from or
write to a named pipe.
-
Sending signals, via the
kill
system call,
allows arbitrary processes to communicate, but the
message consists only of the signal number.
UnixWare also provides an InterProcess Communication (IPC)
package that supports three, more versatile types of interprocess
communication.
For example,
-
Messages allow processes to send formatted data streams to
arbitrary processes.
-
Semaphores allow processes to synchronize execution.
-
Shared memory allows processes to share parts
of their virtual address space.
When implemented as a unit, these three mechanisms
share common properties such as
-
each mechanism contains a ``get'' system call
to create a new entry or retrieve an existing one
-
each mechanism contains a ``control''
system call to query the status of an
entry, to set status information, or to remove
the entry from the system
-
each mechanism contains an ``operations'' system call
to perform various operations on an entry
This section describes the system calls for each of these
three forms of IPC.
This information is for programmers who write multiprocess
applications.
These programmers should have a general
understanding of what semaphores are and how they are used.
Information from other sources would also be helpful.
See
ipcs(1)
and
ipcrm(1),
as well as the following manual pages:
Included in this section are several example programs that
show the use of these IPC system calls.
Since there are many ways
to accomplish
the same task or requirement, keep in mind that the
example programs were written for clarity and not for
program efficiency.
Usually, system calls are
embedded within a larger user-written program that makes use of a
particular function provided by the calls.
Next topic:
Messages
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004