Skip Navigation Links | |
Exit Print View | |
Programming Interfaces Guide Oracle Solaris 11.1 Information Library |
2. Session Description Protocol API
8. Programming With XTI and TLI
10. Transport Selection and Name-to-Address Mapping
11. Real-time Programming and Administration
Basic Rules of Real-time Applications
Factors that Degrade Response Time
Interface Calls That Control Scheduling
Utilities That Control Scheduling
Oracle Solaris Asynchronous I/O
Asynchronous Network Communication
This section describes the interprocess communication (IPC) interfaces of SunOS as the interfaces relate to real-time processing. Signals, pipes, FIFOs, message queues, shared memory, file mapping, and semaphores are described here. For more information about the libraries, interfaces, and routines that are useful for interprocess communication, see Chapter 6, Interprocess Communication.
The sender can use sigqueue to send a signal together with a small amount of information to a target process.
To queue subsequent occurrences of a pending signal, the target process must have the SA_SIGINFO bit set for the specified signal. See the sigaction(2) man page.
The target process normally receive signals asynchronously. To receive signals synchronously, block the signal and call either sigwaitinfo or sigtimedwait. See the sigprocmask(2) man page. This procedure causes the signal to be received synchronously. The value sent by the caller of sigqueue is stored in the si_value member of the siginfo_t argument. Leaving the signal unblocked causes the signal to be delivered to the signal handler specified by sigaction(2), with the value appearing in the si_value of the siginfo_t argument to the handler.
A specified number of signals with associated values can be sent by a process and remain undelivered. Storage for {SIGQUEUE_MAX} signals is allocated at the first call to sigqueue. Thereafter, a call to the command either successfully enqueues at the target process or fails within a bounded amount of time.
Pipes, named pipes, and message queues behave similarly to character I/O devices. These interfaces have different methods of connecting. See Pipes Between Processes for more information about pipes. See Named Pipes for more information about named pipes. See System V Messages and POSIX Messages for more information about message queues.
Semaphores are also provided in both System V and POSIX styles. See System V Semaphores and POSIX Semaphores for more information.
Note that using semaphores can cause priority inversions unless priority inversions are explicitly avoided by the techniques mentioned earlier in this chapter.
The fastest way for processes to communicate is directly, through a shared segment of memory. When more than two processes attempt to read and write shared memory simultaneously, the memory contents can become inaccurate. This potential inaccuracy is the major difficulty with using shared memory.